Legrand / Raritan / Server Technology Xerus™ JSON-RPC API: RoleManager.idl Source File

Legrand / Raritan / Server Technology Xerus™ JSON-RPC API

Loading...
Searching...
No Matches
RoleManager.idl
1/* SPDX-License-Identifier: BSD-3-Clause */
2/*
3 * Copyright 2009 Raritan Inc. All rights reserved.
4 */
5
6#include <Role.idl>
7#include <UserEvent.idl>
8
9/**
10 * %User Management
11 */
12module usermgmt {
13
14 /* event definitions */
15 /**
16 * Base type of all account event
17 */
18 valueobject RoleEvent extends event.UserEvent {
19 string rolename;
20 };
21
22 valueobject RoleAdded extends RoleEvent {};
23
24 valueobject RoleRemoved extends RoleEvent {};
25
26 valueobject RoleChanged extends RoleEvent {
27 Role.Info oldSettings;
28 Role.Info newSettings;
29 };
30
31 /** Role manager interface */
32 interface RoleManager {
33
34 constant int ERR_ROLE_ALREADY_EXISTS = 1; ///< A role with that name already exists
35 constant int ERR_MAX_ROLES_REACHED = 2; ///< Maximum number of roles reached
36 constant int ERR_INVALID_VALUE = 3; ///< Invalid arguments
37
38 constant int ERR_ROLE_DOESNT_EXIST = 1; ///< The role does not exist
39 constant int ERR_ROLE_NOT_DELETABLE = 2; ///< The role cannot be deleted
40
41 /** Privilege Argument Description */
42 structure ArgumentDesc {
43 string name; ///< Argument name
44 string desc; ///< Argument description
45 };
46
47 /** Privilege Description */
48 structure PrivilegeDesc {
49 string name; ///< Privilege name
50 string desc; ///< Privilege description
51 vector<ArgumentDesc> args; ///< List of supported arguments
52 };
53
54 /** Role information */
55 structure RoleAccount {
56 int id; ///< Unique role id
57 string name; ///< Role name
58 Role.Info info; ///< Role information
59 };
60
61 /** Full role manager information */
62 structure Info {
63 vector<PrivilegeDesc> privileges; ///< List of supported privileges
64 vector<RoleAccount> roles; ///< List of active roles
65 };
66
67 /**
68 * Create new role with full information.
69 *
70 * @param name New role name
71 * @param info New role information
72 *
73 * @return 0 if OK
74 * @return 1 if a role with that name already exists
75 * @return 2 if the maximum number of roles is reached
76 * @return 3 if the role information is invalid
77 */
78 int createRoleFull(in string name, in Role.Info info);
79
80 /**
81 * Delete a role.
82 *
83 * @param name Name of the role to delete
84 *
85 * @return 0 if OK
86 * @return 1 if a role with the given name does not exist
87 * @return 2 if the role cannot be deleted
88 */
89 int deleteRole(in string name);
90
91 /**
92 * Retrieve a list of role names
93 *
94 * @return List of role names
95 */
96 vector<string> getAllRoleNames();
97
98 /**
99 * Retrieve a list of active roles.
100 *
101 * @return List of active roles
102 */
103 vector<RoleAccount> getAllRoles();
104
105 /**
106 * Retrieve a list of supported privileges.
107 *
108 * @return List of privilege names
109 */
110 vector<PrivilegeDesc> getAllPrivileges();
111
112 /**
113 * Retrieve full role manager information.
114 *
115 * @return Role manager information
116 */
117 Info getInfo();
118
119 };
120
121}
usermgmt::RoleManager
Role manager interface.
Definition RoleManager.idl:32
usermgmt::RoleManager::getAllRoles
vector< RoleAccount > getAllRoles()
Retrieve a list of active roles.
usermgmt::RoleManager::getAllRoleNames
vector< string > getAllRoleNames()
Retrieve a list of role names.
usermgmt::RoleManager::getInfo
Info getInfo()
Retrieve full role manager information.
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