-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
139 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package roles | ||
|
||
// Name represents a role, which can be assigned to a user or a service user. | ||
// For additional information, see | ||
// https://docs.selectel.ru/control-panel-actions/users-and-roles/user-types-and-roles/#user-roles. | ||
type Name string | ||
|
||
const ( | ||
// Account owner. | ||
AccountOwner Name = "account_owner" | ||
|
||
// User administrator. | ||
IAMAdmin Name = "iam_admin" | ||
|
||
// Account/Project administrator. | ||
Member Name = "member" | ||
|
||
// Account/Project reader. | ||
Reader Name = "reader" | ||
|
||
// Billing administrator. | ||
Billing Name = "billing" | ||
|
||
// Object storage administrator. Can be assigned only to a service user. | ||
ObjectStorageAdmin Name = "object_storage:admin" | ||
|
||
// Object storage user. Can be assigned only to a service user. | ||
ObjectStorageUser Name = "object_storage_user" | ||
) | ||
|
||
// Scope represents a scope of a role. | ||
type Scope string | ||
|
||
const ( | ||
// Project scope. | ||
Project Scope = "project" | ||
|
||
// Account scope. | ||
Account Scope = "account" | ||
) | ||
|
||
type Role struct { | ||
ProjectID string `json:"project_id,omitempty"` | ||
RoleName Name `json:"role_name"` | ||
Scope Scope `json:"scope"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.