Class CPermissionControl#
Defined in File permission_control.h
Inheritance Relationships#
Base Types#
public sdv::IInterfaceAccess(Struct IInterfaceAccess)public sdv::core::IPermissionControl(Struct IPermissionControl)
Class Documentation#
-
class CPermissionControl : public sdv::IInterfaceAccess, public sdv::core::IPermissionControl#
Permission control provides a simple access mechanism to allow the management of access to system functions.
Public Functions
-
CPermissionControl() = default#
Default constructor.
-
virtual sdv::core::TPermissionID RestrictAccessPermission(sdv::core::EAccessPermission ePermission) override#
Restrict the access permission for the current thread. Overload of sdv::core.:IPermissionControl::RestrictAccessPermission.
Remark
The access restriction will be assigned to the current thread and combined with previous and future permissions. The lowest assigned permission will determine the actual access permission for the current thread.
Remark
The access restriction will stay in effect until it is released by the function ReleaseAccessPermission.
Remark
A newly created thread has fully restricted access. This cannot be changed using this function. Use an access restriction transfer from one thread to this thread to set a higher level of access permission.
- Parameters:
ePermission – [in] The permission to restrict to.
- Returns:
The permission ID for this restriction or 0 when the access permission could not be set. Use the ReleaseAccessPermission to release the restriction again.
-
virtual bool ReleaseAccessPermission(sdv::core::TPermissionID tPermissionID) override#
Release a previously set access restriction for the current thread. Overload of sdv::core::IPermissionControl::ReleaseAccessPermission.
- Parameters:
tPermissionID – [in] The ID of the access restriction previously set for the current thread.
- Returns:
Returns whether the restriction could be released successfully.
-
virtual sdv::core::TPermissionTransferID TransferCurrentPermission() override#
Prepare to transfer the access restriction from the current thread.Overload of sdv::core.:IPermissionControl::TransferCurrentPermission.
- Returns:
The ID of the transfer object containing the current access permissions or 0 when the transfer preparation has failed.
-
virtual sdv::core::TPermissionID SetAccessPermission(sdv::core::TPermissionTransferID tTransferID) override#
Set the access permission using a transfer object from one thread to another. Overload of sdv::core.:IPermissionControl::SetAccessPermission.
Remark
An new thread has fully restricted access per default. Use this function to set the required access level. If a thread has already initialized with the proper access level, this function will set identical or lower access permissions for the current thread.
- Parameters:
tTransferID – [in] The IS of the prepared access permission transfer.
- Returns:
The permission ID for this restriction or 0 when the access permission could not be transferred. Use the ReleaseAccessPermission to release the restriction again.
-
virtual sdv::core::EAccessPermission GetCurrentPermission() const override#
Get the access permission level for the current thread. This will be the lowest restriction set for the current thread. Overload of sdv::core.:IPermissionControl::GetCurrentPermission.
- Returns:
The current access permission level.
-
CAccessPermission CreatePermissionObject(sdv::core::EAccessPermission ePermission)#
Create a permission object that assigns the access permissions to the call thread. The permissions stay in place until a last copy of the object is destroyed.
- Parameters:
ePermission – [in] The new permission to set for the thread. If the permission has a value smaller than sdv::core::EAccessPermission::restricted_access, the object will be created with restricted access permission.
- Returns:
The permission object. The permission will stay in place during the lifetime of the object.
Public Members
- friend CAccessPermission
Access permission class can access the permission control.
-
CPermissionControl() = default#