EssGetApplicationAccessEx

アプリケーションへのユーザーまたはグループのアクセス権情報が含まれているユーザーまたはグループのアプリケーション・アクセス構造体のリストを取得します。EssGetApplicationAccessに似ていますが、ユーザー・ディレクトリの指定、またはUserIDの一意のID属性を受け入れることができます。

構文

            ESS_FUNC_M EssGetApplicationAccessEx (
            hCtx
            , 
            UserId
            , 
            bIsIdentity
            , 
            type
            , 
            AppName
            , 
            pCount
            , 
            ppUserApp
            );
         
パラメータデータ型説明

hCtx

ESS_HCTX_T

APIコンテキスト・ハンドル(入力)。

UserId

ESS_STR_T

ユーザー名またはグループ名(入力)。name@providerまたは一意のID属性として指定できます。NULLの場合は、指定したアプリケーションのすべてのユーザーまたはグループがリストされます。

bIsIdentity

ESS_BOOL_T

入力。UserIDが名前かIDかを示します。TRUEの場合、UserIDはIDです。

type

ESS_USHORT_T

エンティティのタイプ(入力)。UserIDがグループかユーザーかを示します。次のいずれかになります:

  • ESS_TYPE_USER

  • ESS_TYPE_GROUP

AppName

ESS_STR_T

アプリケーション名(入力)。NULLの場合は、指定されたユーザーのすべてのアプリケーションをリストします。

pCount

ESS_PUSHORT_T

ユーザーのアプリケーション構造体のカウントを受け取る変数のアドレス(出力)。

ppUserApp

ESS_PPUSERAPPEX_T

割り当てられたユーザー・アプリケーション構造体の配列を受け取るポインタのアドレス(出力)。ユーザー・アプリケーション構造体には、ユーザー・ディレクトリおよび一意のID属性を含められます。

備考

戻り値

正常終了の場合は、ユーザーとアプリケーションのカウントがpCountに、ユーザーのアプリケーション構造体のリストがppUserAppに戻されます。

アクセス

この関数を使用するには、独自のアプリケーションのアクセス情報を取得する場合を除き、呼出し元は指定したアプリケーションに対してアプリケーション・デザイナ権限(ESS_PRIV_APPDESIGN)を持っている必要があります。

         

void DisplayUserAppInfo(ESS_PUSERAPPEX_T userApp, ESS_USHORT_T count)
{
   ESS_STS_T sts = ESS_STS_NOERR;
   ESS_USHORT_T ind;

   printf ("\n------Application Access List----\n\n");    
   for (ind = 0; ind < count; ind++)
   {
      printf("\tUser: %s\n", userApp[ind].UserName);
      printf("\tProvider Name: %s\n", userApp[ind].ProviderName);
      printf("\tConnection Param: %s\n", userApp[ind].connparam);
      printf("\tAppName: %s\n", userApp[ind].AppName);
      switch(userApp[ind].Access)
      {
         case ESS_PRIV_NONE:
            printf("\tAccess: %d - ESS_PRIV_NONE\n", userApp[ind].Access);
            break;
         case ESS_PRIV_READ:
            printf("\tAccess: %d - ESS_PRIV_READ\n", userApp[ind].Access);
            break;
         case ESS_PRIV_WRITE:
            printf("\tAccess: %d - ESS_PRIV_WRITE\n", userApp[ind].Access);
            break;
         case ESS_PRIV_CALC:
            printf("\tAccess: %d - ESS_PRIV_CALC\n", userApp[ind].Access);
            break;
         case ESS_PRIV_METAREAD:
            printf("\tAccess: %d - ESS_PRIV_METAREAD\n", userApp[ind].Access);
            break;
         case ESS_PRIV_DBLOAD:
            printf("\tAccess: %d - ESS_PRIV_DBLOAD\n", userApp[ind].Access);
            break;
         case ESS_PRIV_DBMANAGE:
            printf("\tAccess: %d - ESS_PRIV_DBMANAGE\n", userApp[ind].Access);
            break;
         case ESS_PRIV_DBCREATE:
            printf("\tAccess: %d - ESS_PRIV_DBCREATE\n", userApp[ind].Access);
            break;
         case ESS_PRIV_APPLOAD:
            printf("\tAccess: %d - ESS_PRIV_APPLOAD\n", userApp[ind].Access);
            break;
         case ESS_PRIV_APPMANAGE:
            printf("\tAccess: %d - ESS_PRIV_APPMANAGE\n", userApp[ind].Access);
            break;
         case ESS_PRIV_APPCREATE:
            printf("\tAccess: %d - ESS_PRIV_APPCREATE\n", userApp[ind].Access);
            break;
         case ESS_PRIV_USERCREATE:
            printf("\tAccess: %d - ESS_PRIV_USERCREATE\n", userApp[ind].Access);
            break;

         case ESS_ACCESS_READ:
            printf("\tAccess: %d - ESS_ACCESS_READ\n", userApp[ind].Access);
            break;
         case ESS_ACCESS_WRITE:
            printf("\tAccess: %d - ESS_ACCESS_WRITE\n", userApp[ind].Access);
            break;
         case ESS_ACCESS_CALC:
            printf("\tAccess: %d - ESS_ACCESS_CALC\n", userApp[ind].Access);
            break;
         case ESS_ACCESS_METAREAD:
            printf("\tAccess: %d - ESS_ACCESS_METAREAD\n", userApp[ind].Access);
            break;
         case ESS_ACCESS_DBMANAGE:
            printf("\tAccess: %d - ESS_ACCESS_DBMANAGE\n", userApp[ind].Access);
            break;
         case ESS_ACCESS_DBCREATE:
            printf("\tAccess: %d - ESS_ACCESS_DBCREATE\n", userApp[ind].Access);
            break;
         case ESS_ACCESS_APPMANAGE:
            printf("\tAccess: %d - ESS_ACCESS_APPMANAGE\n", userApp[ind].Access);
            break;
         case ESS_ACCESS_APPCREATE:
            printf("\tAccess: %d - ESS_ACCESS_APPCREATE\n", userApp[ind].Access);
            break;
         case ESS_ACCESS_FILTER:
            printf("\tAccess: %d - ESS_ACCESS_FILTER\n", userApp[ind].Access);
            break;
         case ESS_ACCESS_DBALL:
            printf("\tAccess: %d - ESS_ACCESS_DBALL\n", userApp[ind].Access);
            break;
         case ESS_ACCESS_APPALL:
            printf("\tAccess: %d - ESS_ACCESS_APPALL\n", userApp[ind].Access);
            break;
         case ESS_ACCESS_ADMIN:
            printf("\tAccess: %d - ESS_ACCESS_ADMIN\n", userApp[ind].Access);
            break;
         default:
            printf("\tAccess: Unknown\n");
      }

      switch(userApp[ind].MaxAccess)
      {
         case ESS_PRIV_NONE:
            printf("\tMax Access: %d - ESS_PRIV_NONE\n", userApp[ind].MaxAccess);
            break;
         case ESS_PRIV_READ:
            printf("\tMax Access: %d - ESS_PRIV_READ\n", userApp[ind].MaxAccess);
            break;
         case ESS_PRIV_WRITE:
            printf("\tMax Access: %d - ESS_PRIV_WRITE\n", userApp[ind].MaxAccess);
            break;
         case ESS_PRIV_CALC:
            printf("\tMax Access: %d - ESS_PRIV_CALC\n", userApp[ind].MaxAccess);
            break;
         case ESS_PRIV_METAREAD:
            printf("\tMax Access: %d - ESS_PRIV_METAREAD\n", userApp[ind].MaxAccess);
            break;
         case ESS_PRIV_DBLOAD:
            printf("\tMax Access: %d - ESS_PRIV_DBLOAD\n", userApp[ind].MaxAccess);
            break;
         case ESS_PRIV_DBMANAGE:
            printf("\tMax Access: %d - ESS_PRIV_DBMANAGE\n", userApp[ind].MaxAccess);
            break;
         case ESS_PRIV_DBCREATE:
            printf("\tMax Access: %d - ESS_PRIV_DBCREATE\n", userApp[ind].MaxAccess);
            break;
         case ESS_PRIV_APPLOAD:
            printf("\tMax Access: %d - ESS_PRIV_APPLOAD\n", userApp[ind].MaxAccess);
            break;
         case ESS_PRIV_APPMANAGE:
            printf("\tMax Access: %d - ESS_PRIV_APPMANAGE\n", userApp[ind].MaxAccess);
            break;
         case ESS_PRIV_APPCREATE:
            printf("\tMax Access: %d - ESS_PRIV_APPCREATE\n", userApp[ind].MaxAccess);
            break;
         case ESS_PRIV_USERCREATE:
            printf("\tMax Access: %d - ESS_PRIV_USERCREATE\n", userApp[ind].MaxAccess);
            break;

         case ESS_ACCESS_READ:
            printf("\tMax Access: %d - ESS_ACCESS_READ\n", userApp[ind].MaxAccess);
            break;
         case ESS_ACCESS_WRITE:
            printf("\tMax Access: %d - ESS_ACCESS_WRITE\n", userApp[ind].MaxAccess);
            break;
         case ESS_ACCESS_CALC:
            printf("\tMax Access: %d - ESS_ACCESS_CALC\n", userApp[ind].MaxAccess);
            break;
         case ESS_ACCESS_METAREAD:
            printf("\tMax Access: %d - ESS_ACCESS_METAREAD\n", userApp[ind].MaxAccess);
            break;
         case ESS_ACCESS_DBMANAGE:
            printf("\tMax Access: %d - ESS_ACCESS_DBMANAGE\n", userApp[ind].MaxAccess);
            break;
         case ESS_ACCESS_DBCREATE:
            printf("\tMax Access: %d - ESS_ACCESS_DBCREATE\n", userApp[ind].MaxAccess);
            break;
         case ESS_ACCESS_APPMANAGE:
            printf("\tMax Access: %d - ESS_ACCESS_APPMANAGE\n", userApp[ind].MaxAccess);
            break;
         case ESS_ACCESS_APPCREATE:
            printf("\tMax Access: %d - ESS_ACCESS_APPCREATE\n", userApp[ind].MaxAccess);
            break;
         case ESS_ACCESS_FILTER:
            printf("\tMax Access: %d - ESS_ACCESS_FILTER\n", userApp[ind].MaxAccess);
            break;
         case ESS_ACCESS_DBALL:
            printf("\tMax Access: %d - ESS_ACCESS_DBALL\n", userApp[ind].MaxAccess);
            break;
         case ESS_ACCESS_APPALL:
            printf("\tMax Access: %d - ESS_ACCESS_APPALL\n", userApp[ind].MaxAccess);
            break;
         case ESS_ACCESS_ADMIN:
            printf("\tMax Access: %d - ESS_ACCESS_ADMIN\n", userApp[ind].MaxAccess);
            break;
         default:
            printf("\tMax Access: Unknown\n");
      }

      printf("\n");
   }
}

ESS_FUNC_M ESS_GetApplicationAccessEx (ESS_HCTX_T hCtx, ESS_HINST_T hInst)

{
   ESS_STS_T sts = ESS_STS_NOERR;
   ESS_STR_T userId;
   ESS_BOOL_T bIsIdentity;
   ESS_USHORT_T type;
   ESS_USHORT_T count = 0;
   ESS_USERAPPEX_T userApp[2];
   ESS_PUSERAPPEX_T pUserApp = ESS_NULL;
   
   count = 1;
   strcpy(userApp[0].UserName, "IDUser1");
   strcpy(userApp[0].ProviderName, "");
   strcpy(userApp[0].connparam, "");
   userApp[0].type = ESS_TYPE_USER;
   strcpy(userApp[0].AppName, AppName);
   userApp[0].Access = ESS_PRIV_APPMANAGE;
   userApp[0].MaxAccess = ESS_PRIV_APPMANAGE;
   sts = EssSetApplicationAccessEx(hCtx, count, &userApp);
   printf("EssSetApplicationAccessEx sts: %ld\n", sts);
   
   userId = "IDUser1";
   AppName = AppName;
   type = ESS_TYPE_GROUP;
   bIsIdentity = ESS_FALSE;
   sts = EssGetApplicationAccessEx(hCtx, userId, bIsIdentity, type, AppName, &count, &pUserApp);
   printf("EssGetApplicationAccessEx sts: %ld\n", sts);
   if(!sts)
   {
      if(count && pUserApp)
      {  
         DisplayUserAppInfo(pUserApp, count);         
         sts = EssFree (hInst, pUserApp);        
      }
      else
         printf ("\rUser Application list is empty\n\n");    
   }
   return (sts);
}

      

関連トピック