Loading...
Searching...
No Matches
RoleManager.idl
/* SPDX-License-Identifier: BSD-3-Clause */
/*
* Copyright 2009 Raritan Inc. All rights reserved.
*/
#include <Role.idl>
#include <UserEvent.idl>
/**
* %User Management
*/
module usermgmt {
/* event definitions */
/**
* Base type of all account event
*/
valueobject RoleEvent extends event.UserEvent {
string rolename;
};
valueobject RoleAdded extends RoleEvent {};
valueobject RoleRemoved extends RoleEvent {};
valueobject RoleChanged extends RoleEvent {
Role.Info oldSettings;
Role.Info newSettings;
};
/** Role manager interface */
interface RoleManager {
constant int ERR_ROLE_ALREADY_EXISTS = 1; ///< A role with that name already exists
constant int ERR_MAX_ROLES_REACHED = 2; ///< Maximum number of roles reached
constant int ERR_INVALID_VALUE = 3; ///< Invalid arguments
constant int ERR_ROLE_DOESNT_EXIST = 1; ///< The role does not exist
constant int ERR_ROLE_NOT_DELETABLE = 2; ///< The role cannot be deleted
/** Privilege Argument Description */
structure ArgumentDesc {
string name; ///< Argument name
string desc; ///< Argument description
};
/** Privilege Description */
structure PrivilegeDesc {
string name; ///< Privilege name
string desc; ///< Privilege description
vector<ArgumentDesc> args; ///< List of supported arguments
};
/** Role information */
structure RoleAccount {
int id; ///< Unique role id
string name; ///< Role name
Role.Info info; ///< Role information
};
/** Full role manager information */
structure Info {
vector<PrivilegeDesc> privileges; ///< List of supported privileges
vector<RoleAccount> roles; ///< List of active roles
};
/**
* Create new role with full information.
*
* @param name New role name
* @param info New role information
*
* @return 0 if OK
* @return 1 if a role with that name already exists
* @return 2 if the maximum number of roles is reached
* @return 3 if the role information is invalid
*/
int createRoleFull(in string name, in Role.Info info);
/**
* Delete a role.
*
* @param name Name of the role to delete
*
* @return 0 if OK
* @return 1 if a role with the given name does not exist
* @return 2 if the role cannot be deleted
*/
int deleteRole(in string name);
/**
* Retrieve a list of role names
*
* @return List of role names
*/
vector<string> getAllRoleNames();
/**
* Retrieve a list of active roles.
*
* @return List of active roles
*/
vector<RoleAccount> getAllRoles();
/**
* Retrieve a list of supported privileges.
*
* @return List of privilege names
*/
vector<PrivilegeDesc> getAllPrivileges();
/**
* Retrieve full role manager information.
*
* @return Role manager information
*/
Info getInfo();
};
}
usermgmt::RoleManager
Role manager interface.
Definition RoleManager.idl:32
usermgmt::RoleManager::getAllRoles
vector< RoleAccount > getAllRoles()
Retrieve a list of active roles.
usermgmt::RoleManager::ERR_ROLE_DOESNT_EXIST
constant int ERR_ROLE_DOESNT_EXIST
The role does not exist.
Definition RoleManager.idl:38
usermgmt::RoleManager::ERR_ROLE_NOT_DELETABLE
constant int ERR_ROLE_NOT_DELETABLE
The role cannot be deleted.
Definition RoleManager.idl:39
usermgmt::RoleManager::ERR_MAX_ROLES_REACHED
constant int ERR_MAX_ROLES_REACHED
Maximum number of roles reached.
Definition RoleManager.idl:35
usermgmt::RoleManager::getAllRoleNames
vector< string > getAllRoleNames()
Retrieve a list of role names.
usermgmt::RoleManager::getInfo
Info getInfo()
Retrieve full role manager information.
usermgmt::RoleManager::ERR_ROLE_ALREADY_EXISTS
constant int ERR_ROLE_ALREADY_EXISTS
A role with that name already exists.
Definition RoleManager.idl:34
usermgmt::RoleManager::ERR_INVALID_VALUE
constant int ERR_INVALID_VALUE
Invalid arguments.
Definition RoleManager.idl:36
usermgmt::RoleManager::createRoleFull
int createRoleFull(in string name, in Role::Info info)
Create new role with full information.
usermgmt::RoleManager::deleteRole
int deleteRole(in string name)
Delete a role.
usermgmt::RoleManager::getAllPrivileges
vector< PrivilegeDesc > getAllPrivileges()
Retrieve a list of supported privileges.
usermgmt::Role
Role management interface
Definition Role.idl:15
usermgmt
User Management
Definition Role.idl:12
usermgmt::RoleAdded
Definition RoleManager.idl:22
usermgmt::RoleChanged
Definition RoleManager.idl:26
usermgmt::RoleEvent
Base type of all account event.
Definition RoleManager.idl:18
usermgmt::RoleManager::ArgumentDesc
Privilege Argument Description.
Definition RoleManager.idl:42
usermgmt::RoleManager::ArgumentDesc::name
string name
Argument name.
Definition RoleManager.idl:43
usermgmt::RoleManager::ArgumentDesc::desc
string desc
Argument description.
Definition RoleManager.idl:44
usermgmt::RoleManager::Info
Full role manager information.
Definition RoleManager.idl:62
usermgmt::RoleManager::Info::roles
vector< RoleAccount > roles
List of active roles.
Definition RoleManager.idl:64
usermgmt::RoleManager::Info::privileges
vector< PrivilegeDesc > privileges
List of supported privileges.
Definition RoleManager.idl:63
usermgmt::RoleManager::PrivilegeDesc
Privilege Description.
Definition RoleManager.idl:48
usermgmt::RoleManager::PrivilegeDesc::args
vector< ArgumentDesc > args
List of supported arguments.
Definition RoleManager.idl:51
usermgmt::RoleManager::PrivilegeDesc::name
string name
Privilege name.
Definition RoleManager.idl:49
usermgmt::RoleManager::PrivilegeDesc::desc
string desc
Privilege description.
Definition RoleManager.idl:50
usermgmt::RoleManager::RoleAccount
Role information.
Definition RoleManager.idl:55
usermgmt::RoleManager::RoleAccount::info
Role::Info info
Role information.
Definition RoleManager.idl:58
usermgmt::RoleManager::RoleAccount::name
string name
Role name.
Definition RoleManager.idl:57
usermgmt::RoleManager::RoleAccount::id
int id
Unique role id.
Definition RoleManager.idl:56
usermgmt::RoleRemoved
Definition RoleManager.idl:24
usermgmt::Role::Info
Role information
Definition Role.idl:26