EssSetApplicationAccessEx

アプリケーションへのユーザーのアクセス権情報を含むユーザー・アプリケーション・アクセス構造体のリストを設定します。EssSetApplicationAccessに似ていますが、入力構造体には、ユーザー・ディレクトリおよび一意のID属性を含められます。

構文

            ESS_FUNC_M EssSetApplicationAccessEx (
            hCtx
            , 
            Count
            , 
            pUserApp
            );
         
パラメータデータ型説明

hCtx

ESS_HCTX_T

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

Count

ESS_USHORT_T

ユーザー・アプリケーション構造体のカウント(入力)。

pUserApp

ESS_PUSERAPPEX_T

ユーザー・アプリケーション構造体の配列へのポインタ(入力)。

備考

ユーザー・アプリケーション構造体のAccessフィールドを使用して、ユーザーに付与されたアプリケーションへのアクセスを設定します。この呼出しではMaxAccessフィールドは無視されます。

戻り値

なし。

アクセス

この関数を使用するには、呼出し元が、指定されたアプリケーションに対してアプリケーション設計権限(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_SetApplicationAccessEx (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_STR_T AppName;
   ESS_USHORT_T count;
   ESS_USERAPPEX_T userApp[2];
   ESS_PUSERAPPEX_T pUserApp = ESS_NULL;

   memset(&userApp, '\0', sizeof(userApp));

   userId = "IDUser1";
   AppName  = "";
   type = ESS_TYPE_USER;
   bIsIdentity = ESS_FALSE;

   count = 1;
   strcpy(userApp[0].UserName, "IDUser1");
   strcpy(userApp[0].ProviderName, "LDAP");
   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);
   if(!sts)
   {
      userId = userApp[0].UserName;
      type = userApp[0].type;
      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);
}
      

関連トピック