edmiChangeInstanceOwner

EdmiError edmiChangeInstanceOwner(SdaiAppInstance currInst,
                                  SdaiInstance    userORgroupId,
                                  SdaiUnsignedInt options);

Changes the owner of a protected instance, an instance owner may be an EDMuser or an EDMgroup. EDMusers are denoted owners. EDMgroups are denoted owner groups. Any protected instance may be owned by an EDMuser and/or an EDMgroup. By default, that will be the EDMuser/EDMgroup that initially created the instance. Ownership may be granted to any new EDMuser and/or EDMgroup by superuser.  If the database is created with EXTENDED_ACCESS_CHECKING, changing the owner/owner group of an instance, will also cause the owner/owner group to be added to the list of instance administrators. Only the superuser may change ownership of instances.

Arguments


TypeNameComment
SdaiAppInstance

CurrInst

A numeric instanceID that uniquely identifies an instance in the EDMdatabase that for which owner is to be changed. This instanceID is defined when the actual instance is created by the sdaiCreateInstance or sdaiCreateInstanceBN operation.

SdaiInstance

UserORgroupId

A numeric instanceID that uniquely identifies the EDMuser or EDMgroup instance in the EDMdatabase that defines the owner of the instance.

SdaiUnsignedInt

Options

Specifies the options to be used in the invocation of the edmiChangeInstanceOwner function. The <options> value can be specified as a bitwise OR between the actual options to enable. All option names are defined in the header file sdai.h .
See detailed descriptions of the available options below.

Return Value


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

 

Options


  

OptionComment

FOR_ALL_OWNED_INSTANCES

 

REMOVE_AS_ADMINISTRATOR

Remove the EDMuser or EDMgroup from the list of administrators.

UNSET_OWNER

Unset the instance owner attribute

UNSET_OWNER_GROUP

Unset the instance owner group attribute

SET_OWNER

Set the given EDMuser as instance owner.

SET_OWNER_GROUP

Set the given EDMgroup as instance owner group.

REPLACE_CURRENT

Replace the existing owner/owner group with the given EDMuser/EDMgroup.

 

Example


 

EdmiError rstat;
 SdaiModel modId;
 SdaiUser myUserId;
 . . .
 if (modId = edmiGetModelBN("myRepository", "myModel")) {
 edmiGetMyUserId(&myuserId);
 edmiChangeMyUserBN("superuser", "", pwd, &message, &sesskey);
 if (rstat = edmiChangeInstanceOwner(modId, myUserId,
 SET_OWNER | REPLACE_CURRENT)) {
 /* Error in operation */ 
 printf("\nError in edmiChangeInstanceOwner: %s", 
 edmiGetErrorText(rstat)); 
 goto error; 
 } 
  
 . . .

 

See also

Filter by label

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

 

Â