Revokes individually set access rights for an EDMuser or an EDMgroup from a protected instance in a remote EDMdatabase.
Owners and administrators can not have their access rights increased or reduced by individual access rights. Only owners, administrators and the superuser may use this function.
Related functions: edmiRemoteCheckInstanceAccess, edmiRemoteGetInstanceAccessRights, edmiRemoteDefineAccessRights, edmiRemoteChangeInstanceOwner, edmiRemoteProtectInstance.
Header:
#include "sdai.h"
Prototype:
EdmiError edmiRemoteDeleteAccessRights(SdaiServerContext serverContextId,
SdaiAppInstance currInst,
SdaiInstance userORgroupId,
SdaiInvocationId *edmiInvocationId);
Arguments:
serverContextId |
Context identification, from edmiDefineServerContext |
currInst |
A numeric instanceID that uniquely identifies a protected instance in the EDMdatabase for which individual access rights are to be revoked for an EDMuser or EDMgroup. |
userORgroupId |
A numeric instanceID that uniquely identifies an EDMuser or EDMgroup instance in the EDMdatabase for which all individually granted access rights to the protected instance given by argument <currInst> shall be revoked. |
edmiInvocationId |
Currently not used. |
Returns:
A completion code of datatype EdmiError is the returned function value. The completion code has the following values:
Completion code = 0 : Operation successfully performed.
Completion code != 0: Error in operation. Completion code is an _EDMinterface_ error code. Use edmiGetErrorText to get the error text corresponding to the error code.
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;
}
. . .