Skip to content

Commit 1a891d3

Browse files
committed
User: add interfaces and errors for groups
As proposed in the following design, [1] https://github.com/openbmc/docs/blob/master/designs/redfish-authorization.md The UserManager interface needs to expose new interfaces to add/delete secondary groups, which are then used to model Redfish roles and privileges. An implementation is in the follow code review, [1] https://gerrit.openbmc.org/c/openbmc/phosphor-user-manager/+/58143. Signed-off-by: Nan Zhou <[email protected]> Change-Id: I252e56dc03e694e3aedf3ae6fdda64edc947fc06
1 parent 219368b commit 1a891d3

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

yaml/xyz/openbmc_project/User/Common.errors.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,9 @@
1616
# xyz.openbmc_project.User.Common.Error.PrivilegeMappingExists
1717
- name: PrivilegeMappingExists
1818
description: Specified privilege mapping already exists.
19+
# xyz.openbmc_project.User.Common.Error.GroupNameExists
20+
- name: GroupNameExists
21+
description: Specified group name already exists.
22+
# xyz.openbmc_project.User.Common.Error.GroupNameDoesNotExist
23+
- name: GroupNameDoesNotExist
24+
description: Specified group name does not exist.

yaml/xyz/openbmc_project/User/Common.metadata.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,7 @@
1717
meta:
1818
- str: "REASON=%s"
1919
type: string
20+
- name: GroupNameExists
21+
level: ERR
22+
- name: GroupNameDoesNotExist
23+
level: ERR

yaml/xyz/openbmc_project/User/Manager.interface.yaml

+28
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,34 @@ methods:
100100
- xyz.openbmc_project.Common.Error.InvalidArgument
101101
- xyz.openbmc_project.User.Common.Error.UserNameDoesNotExist
102102

103+
- name: CreateGroup
104+
description: >
105+
Creates a new groups. If the group already exists, or the
106+
group name is not allowed to be created, it throws an error.
107+
parameters:
108+
- name: GroupName
109+
type: string
110+
description: >
111+
The group to be added to the system.
112+
errors:
113+
- xyz.openbmc_project.Common.Error.InternalFailure
114+
- xyz.openbmc_project.Common.Error.InvalidArgument
115+
- xyz.openbmc_project.User.Common.Error.GroupNameExists
116+
117+
- name: DeleteGroup
118+
description: >
119+
Deletes an existing groups. If the group doesn't exists, or the
120+
group name is not allowed to be deleted, it throws an error.
121+
parameters:
122+
- name: GroupName
123+
type: string
124+
description: >
125+
The group to be deleted from the system.
126+
errors:
127+
- xyz.openbmc_project.Common.Error.InternalFailure
128+
- xyz.openbmc_project.Common.Error.InvalidArgument
129+
- xyz.openbmc_project.User.Common.Error.GroupNameDoesNotExist
130+
103131
properties:
104132
- name: AllPrivileges
105133
type: array[string]

0 commit comments

Comments
 (0)