Raritan / Server Technology Xerus™ PDU JSON-RPC API
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  */
12 module 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  */
118 
119  };
120 
121 }
Role manager interface.
Definition: RoleManager.idl:32
vector< string > getAllRoleNames()
Retrieve a list of role names.
vector< RoleAccount > getAllRoles()
Retrieve a list of active roles.
Info getInfo()
Retrieve full role manager information.
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
valueobject RoleEvent
Base type of all account event.
Definition: RoleManager.idl:19
Privilege Argument Description.
Definition: RoleManager.idl:42
string name
Argument name.
Definition: RoleManager.idl:43
string desc
Argument description.
Definition: RoleManager.idl:44
Full role manager information.
Definition: RoleManager.idl:62
vector< RoleAccount > roles
List of active roles.
Definition: RoleManager.idl:64
vector< PrivilegeDesc > privileges
List of supported privileges.
Definition: RoleManager.idl:63
Privilege Description.
Definition: RoleManager.idl:48
vector< ArgumentDesc > args
List of supported arguments.
Definition: RoleManager.idl:51
string name
Privilege name.
Definition: RoleManager.idl:49
string desc
Privilege description.
Definition: RoleManager.idl:50
Role information.
Definition: RoleManager.idl:55
Role::Info info
Role information.
Definition: RoleManager.idl:58
string name
Role name.
Definition: RoleManager.idl:57
int id
Unique role id.
Definition: RoleManager.idl:56
Role information
Definition: Role.idl:26