Legrand / Raritan Xerus™ JSON-RPC API for Remote Access Devices like KX4-101, KX3G2

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 /** Restriction Description */
55 structure RestrictionDesc {
56 string name; ///< Privilege name
57 string desc; ///< Privilege description
58 vector<ArgumentDesc> args; ///< List of supported arguments
59 };
60
61 /** Role information */
62 structure RoleAccount {
63 int id; ///< Unique role id
64 string name; ///< Role name
65 Role.Info info; ///< Role information
66 };
67
68 /** Full role manager information */
69 structure Info {
70 vector<PrivilegeDesc> privileges; ///< List of supported privileges
71 vector<RestrictionDesc> restrictions; ///< List of supported restrictions
72 vector<RoleAccount> roles; ///< List of active roles
73 };
74
75 /**
76 * Create new role with full information.
77 *
78 * @param name New role name
79 * @param info New role information
80 *
81 * @return 0 if OK
82 * @return 1 if a role with that name already exists
83 * @return 2 if the maximum number of roles is reached
84 * @return 3 if the role information is invalid
85 */
86 int createRoleFull(in string name, in Role.Info info);
87
88 /**
89 * Delete a role.
90 *
91 * @param name Name of the role to delete
92 *
93 * @return 0 if OK
94 * @return 1 if a role with the given name does not exist
95 * @return 2 if the role cannot be deleted
96 */
97 int deleteRole(in string name);
98
99 /**
100 * Retrieve a list of role names
101 *
102 * @return List of role names
103 */
104 vector<string> getAllRoleNames();
105
106 /**
107 * Retrieve a list of active roles.
108 *
109 * @return List of active roles
110 */
111 vector<RoleAccount> getAllRoles();
112
113 /**
114 * Retrieve a list of supported privileges.
115 *
116 * @return List of privilege names
117 */
118 vector<PrivilegeDesc> getAllPrivileges();
119
120 /**
121 * Retrieve a list of supported restrictions.
122 *
123 * @return List of restriction names
124 */
125 vector<RestrictionDesc> getAllRestrictions();
126
127 /**
128 * Retrieve full role manager information.
129 *
130 * @return Role manager information
131 */
132 Info getInfo();
133
134 };
135
136}
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::getAllRestrictions
vector< RestrictionDesc > getAllRestrictions()
Retrieve a list of supported restrictions.
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:69
usermgmt::RoleManager::Info::roles
vector< RoleAccount > roles
List of active roles.
Definition RoleManager.idl:72
usermgmt::RoleManager::Info::privileges
vector< PrivilegeDesc > privileges
List of supported privileges.
Definition RoleManager.idl:70
usermgmt::RoleManager::Info::restrictions
vector< RestrictionDesc > restrictions
List of supported restrictions.
Definition RoleManager.idl:71
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::RestrictionDesc
Restriction Description.
Definition RoleManager.idl:55
usermgmt::RoleManager::RestrictionDesc::desc
string desc
Privilege description.
Definition RoleManager.idl:57
usermgmt::RoleManager::RestrictionDesc::name
string name
Privilege name.
Definition RoleManager.idl:56
usermgmt::RoleManager::RestrictionDesc::args
vector< ArgumentDesc > args
List of supported arguments.
Definition RoleManager.idl:58
usermgmt::RoleManager::RoleAccount
Role information.
Definition RoleManager.idl:62
usermgmt::RoleManager::RoleAccount::info
Role::Info info
Role information.
Definition RoleManager.idl:65
usermgmt::RoleManager::RoleAccount::name
string name
Role name.
Definition RoleManager.idl:64
usermgmt::RoleManager::RoleAccount::id
int id
Unique role id.
Definition RoleManager.idl:63
usermgmt::RoleRemoved
Definition RoleManager.idl:24
usermgmt::Role::Info
Role information
Definition Role.idl:32