...
Code Block | ||||
---|---|---|---|---|
| ||||
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
...
Type | Name | Comment |
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 . |
Return Value
...
Insert excerpt | |||||
---|---|---|---|---|---|
|
|
Options
...
Option | Comment |
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. |
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;
SdaiModel modId;
SdaiUser myUserId;
. . .
if (modId =
Example
...
Code Block | ||
---|---|---|
| ||
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 (Content by label) | ||||||
---|---|---|---|---|---|---|
|
. . .