edmiRemoteGetInstanceAccessRights

EdmiError edmiRemoteGetInstanceAccessRights(SdaiServerContext serverContextId,
                                              SdaiInstance      currInst,
                                              SdaiVersion       version,
                                              SdaiInstance      *ownerId,
                                              SdaiInstance      *groupOwnerId,
                                              SdaiUnsignedInt   *protection,
                                              SdaiInstance      **administrators,
                                              SdaiVoid          *accessFor,
                                              SdaiInvocationId  *edmiInvocationId);


Returns all protection settings of a protected instance in a remote EDMdatabase.

Arguments


TypeNameComment
SdaiServerContext

serverContextId

Context identification, from edmiDefineServerContext

SdaiInstance

currInst

A numeric instanceID that uniquely identifies a protected instance for which the protection info shall be returned. This instanceId may represent any protected object in the remote EDMdatabase such as models, repositories, schemas and containers.

SdaiVersion

version

If the <currInst> argument is a modelId, this argument specifies which version of the model to return protection info for. This argument is a sequence number counting from one. For each new version created this number will be incremented by one.

SdaiInstance

ownerId

Variable that will receive the userId of the EDMuser that owns the protected instance. Will be zero if the protected instance has no owner.

SdaiInstance

groupOwnerId

Variable that will receive the groupId of the EDMgroup that owns the protected instance. Will be zero if the protected instance has no owner group.

SdaiUnsignedInt

protection

Returns the protection code of the specified protected instance. The value is a bitwise OR of any combination of the symbols listed below.
OWNER_READ, OWNER_WRITE, OWNER_CREATE, OWNER_EXECUTE, OWNER_DELETE, OWNER_NONE, GROUP_READ, GROUP_WRITE, GROUP_CREATE, GROUP_EXECUTE, GROUP_DELETE, GROUP_NONE, PUBLIC_READ, PUBLIC_WRITE, PUBLIC_CREATE, PUBLIC_EXECUTE, PUBLIC_DELETE, PUBLIC_NONE

SdaiInstance

administrators

Variable that will receive a zero-terminated buffer with a list of all the administrators of the protected instance. Administrators may be both EDMusers and EDMgroups.

SdaiVoid

accessFor

zero-terminated buffer of userIds and/or groupIds, each combined with their individually set 5bit access rights code. The access rights code is a bitwise OR of any combination of the symbols below:
DELETE_ACCESS, EXECUTE_ACCESS, CREATE_ACCESS, WRITE_ACCESS, READ_ACCESS

SdaiInvocationId

edmiInvocationId

Currently not used.

Return Value


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

 

Options


  

 

Example


 

 EdmiError rstat;
 SdaiServerContext myContext;
 SdaiRepository repId;
 SdaiModel modId;
 SdaiInteger protCode;
 SdaiInstance *pAdmin, owner, groupOwner, directorId;
 struct {
 SdaiInstance Id; 
 SdaiInteger Code; 
 } *pAccessFor;
  
 /* Define Remote Server Context */
 rstat = edmiDefineServerContext("MyRemoteServerContext",
 "Superuser", NULL, "cf37ftr", 
 "TCP", "9090", "MyServerHost", 
 NULL, NULL, NULL, NULL, NULL, &myContext); 
  
 /* Get Johnnys hour list model */
 rstat = edmiRemoteGetUser(myContext, "Director", &directorId, NULL);
 rstat = edmiRemoteGetRepository(myContext, "StaffRepository",
 &repId, NULL); 
 rstat = edmiRemoteGetModel(myContext, repId,
 "JohnnysHourList", &modId, NULL); 
  
 /* Get all protection info */
 rstat = edmiRemoteGetInstanceAccessRights(myContext, modId, 0,
 &owner, &groupOwner, &protCode,  
 &pAdmin, &pAccessFor, NULL); 
  
 /* Remove Directors individually set access */
 while(pAccessFor->Id) {
 if (pAccessFor->Id == directorId) { 
 rstat = edmiRemoteDeleteAccessRights(myContext,  
 modId, directorId, NULL); 
 break; 
 } 
 ++pAccessFor; 
 }
 . . .

 

See also

Filter by label

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

Â