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 */
133
134 };
135
136}
Role manager interface.
vector< RoleAccount > getAllRoles()
Retrieve a list of active roles.
constant int ERR_ROLE_DOESNT_EXIST
The role does not exist.
constant int ERR_ROLE_NOT_DELETABLE
The role cannot be deleted.
constant int ERR_MAX_ROLES_REACHED
Maximum number of roles reached.
vector< RestrictionDesc > getAllRestrictions()
Retrieve a list of supported restrictions.
vector< string > getAllRoleNames()
Retrieve a list of role names.
Info getInfo()
Retrieve full role manager information.
constant int ERR_ROLE_ALREADY_EXISTS
A role with that name already exists.
constant int ERR_INVALID_VALUE
Invalid arguments.
int createRoleFull(in string name, in Role::Info info)
Create new role with full information.
int deleteRole(in string name)
Delete a role.
vector< PrivilegeDesc > getAllPrivileges()
Retrieve a list of supported privileges.
Role management interface
Definition Role.idl:15
User Management
Definition Role.idl:12
Base type of all account event.
Privilege Argument Description.
string desc
Argument description.
Full role manager information.
vector< RoleAccount > roles
List of active roles.
vector< PrivilegeDesc > privileges
List of supported privileges.
vector< RestrictionDesc > restrictions
List of supported restrictions.
vector< ArgumentDesc > args
List of supported arguments.
string desc
Privilege description.
string desc
Privilege description.
vector< ArgumentDesc > args
List of supported arguments.
Role::Info info
Role information.
Role information
Definition Role.idl:32