edmiRemoteCheckInstanceAccess

EdmiError edmiRemoteCheckInstanceAccess(SdaiServerContext serverContextId,
                                         SdaiInstance      currInst,
                                         SdaiVersion       version,
                                         SdaiInteger       requiredAccessCode,
                                         SdaiInstance      userId,
                                         SdaiInstance      groupId,
                                         SdaiUnsignedInt   options,
                                         SdaiBoolean       *result,
                                         SdaiInstance      *lastCheckedInstance,
                                         SdaiInteger       *accessRole,
                                         SdaiInteger       *protection,
                                         SdaiInteger       *actualAccessRights,
                                         SdaiInvocationId  *edmiInvocationId);

 Checks whether an EDMuser/EDMgroup has been granted a requested access to a given protected instance.

 

Arguments


  

Error rendering macro 'excerpt-include' : User 'null' does not have permission to view the page 'US:_a_serverContextId'.
Error rendering macro 'excerpt-include' : User 'null' does not have permission to view the page 'US:_a_currInst_EDMI'.
   
Error rendering macro 'excerpt-include' : User 'null' does not have permission to view the page 'US:_a_version_EDMI'.
 
Error rendering macro 'excerpt-include' : User 'null' does not have permission to view the page 'US:_a_requiredAccessCode_EDMI'.
Error rendering macro 'excerpt-include' : User 'null' does not have permission to view the page 'US:_a_userId_EDMI'.
 
Error rendering macro 'excerpt-include' : User 'null' does not have permission to view the page 'US:_a_groupId_EDMI'.
  
Error rendering macro 'excerpt-include' : User 'null' does not have permission to view the page 'US:_a_options_EDMI'.
 
Error rendering macro 'excerpt-include' : User 'null' does not have permission to view the page 'US:_a_result_EDMI'.
 
Error rendering macro 'excerpt-include' : User 'null' does not have permission to view the page 'US:_a_lastCheckedInstance_EDMI'.
 
Error rendering macro 'excerpt-include' : User 'null' does not have permission to view the page 'US:_a_accessRole_EDMI'.
 
Error rendering macro 'excerpt-include' : User 'null' does not have permission to view the page 'US:_a_protection_EDMI'.
 
Error rendering macro 'excerpt-include' : User 'null' does not have permission to view the page 'US:_a_actualAccessRights_EDMI'.
  
Error rendering macro 'excerpt-include' : User 'null' does not have permission to view the page 'US:_a_edmiInvocationId'.

        

Return Value


Error rendering macro 'excerpt-include' : User 'null' does not have permission to view the page 'US:_r_EDMInterface'.

Options


  

Error rendering macro 'excerpt-include' : User 'null' does not have permission to view the page 'US:_o_CHECK_FULL_PATH'.
                    
           

 

Example


 

EdmiError rstat;
SdaiInstance instId;
SdaiServerContext myContext;
SdaiRepository repId;
SdaiModel modId;
SdaiInstance userId, directorId;
SdaiBoolean gotAccess;
SdaiInteger accessRole, protCode, accRights;
 
/* Define Remote Server Context */
rstat = edmiDefineServerContext("MyRemoteServerContext",
"Superuser", NULL, "cf37ftr", 
"TCP", "9090", "MyServerHost", 
NULL, NULL, NULL, NULL, NULL, &myContext); 
 
/* Check if Johnny got access */
rstat = edmiRemoteGetRepository(myContext, "StaffRepository",
&repId, NULL); 
rstat = edmiRemoteGetUser(myContext, "Johnny", &userId, NULL);
rstat = edmiRemoteCheckInstanceAccess(myContext, repId, 0,
(WRITE_ACCESS|CREATE_ACCESS), userId, 0, 0,  
&gotAccess, &instId, &accessRole,  
&protCode, &accRights, NULL); 
 
/* Check if access may be granted */
if (gotAccess != sdaiTRUE) {
/* Check if Johnny was individually excluded */ 
if (accessRole == ACCESS_FOR_USER) { 
printf("\nSorry Johnny has already been excluded."); 
goto err; 
} else if (accessRole != PUBLIC_ACCESS) { 
printf("\nJohnny is owner or administrator."); 
printf("\nIndividual access rights will have no effect."); 
goto err; 
} else { 
/* Grant access to Johnny on the StaffRepository */ 
rstat = edmiRemoteDefineAccessRights(myContext, repId,  
userId, (WRITE_ACCESS|CREATE_ACCESS), NULL); 
} 
}
 
/* Create Johnnys Hour List Model */
rstat = edmiRemoteCreateModel(myContext, "StaffRepository",
"JohnnysHourList", "HOUR_LIST_SCHEMA", 0, NULL); 
 
rstat = edmiRemoteGetModel(myContext, repId,
"JohnnysHourList", &modId, NULL); 
 
/* Change ownership */
rstat = edmiRemoteChangeInstanceOwner(myContext, modId,
userId, (SET_OWNER|REPLACE_CURRENT), NULL); 
 
/* Set protection */
rstat = edmiRemoteProtectInstance(myContext, modId,
(GROUP_NONE|PUBLIC_NONE|OWNER_CREATE| 
OWNER_DELETE|OWNER_WRITE), NULL); 
 
/* Grant read access to director */
rstat = edmiRemoteGetUser(myContext, "Director", &directorId, NULL);
rstat = edmiRemoteDefineAccessRights(myContext, modId,
directorId, READ_ACCESS, NULL); 
. . .

 

See also

Filter by label

There are no items with the selected labels at this time.