Deauthorize() 공개 메소드

Removes container-level permission from specified User API client. Requires Backend API key with Admin permission role. The collection_id/collection_key parameter means that one can use either one of them - collection_id or collection_key.
public Deauthorize ( string apiClientId, Permissions permission, string projectId, string folderName, string collectionId = null, string collectionKey = null ) : Task
apiClientId string User API client id.
permission Permissions User API client's permission to remove.
projectId string Project containing specified container.
folderName string Folder name defining folder that permission will be removed from.
collectionId string Collection containing specified container.
collectionKey string Collection containing specified container.
리턴 Task
 public async Task Deauthorize_WithNullFolderName_ThrowsException(FolderSyncanoClient client)
 {
     try
     {
         //when
         await client.Deauthorize(TestData.UserApiClientId, Permissions.DeleteData, TestData.ProjectId,
                 null, TestData.CollectionId);
         throw new Exception("Deauthorize should throw an exception");
     }
     catch (Exception e)
     {
         //then
         e.ShouldBeType<ArgumentNullException>();
     }
 }
 public async Task Deauthorize_WithInvalidUserApiKey_ThrowsException(FolderSyncanoClient client)
 {
     try
     {
         //when
         await client.Deauthorize("abcde", Permissions.DeleteData, TestData.ProjectId,
                 TestData.FolderName, TestData.CollectionId);
         throw new Exception("Deauthorize should throw an exception");
     }
     catch (Exception e)
     {
         //then
         e.ShouldBeType<SyncanoException>();
     }
 }
        public async Task Deauthorize_ByCollectionKey(FolderSyncanoClient client)
        {
            //given
            string folderName = "Authorize Test " + DateTime.Now.ToLongTimeString() + " " +
                                DateTime.Now.ToShortDateString();

            await client.New(TestData.ProjectId, folderName, collectionKey: TestData.CollectionKey);
            await client.Authorize(TestData.UserApiClientId, Permissions.CreateData, TestData.ProjectId,
                        TestData.FolderName, collectionKey: TestData.CollectionKey);

            //when
            var result = await client.Deauthorize(TestData.UserApiClientId, Permissions.CreateData, TestData.ProjectId,
                        TestData.FolderName, collectionKey: TestData.CollectionKey);

            //then
            result.ShouldBeTrue();

            //cleanup
            await client.Delete(TestData.ProjectId, folderName, collectionKey: TestData.CollectionKey);
        }