2023-08-02 03:39:48 +00:00
|
|
|
package config
|
|
|
|
|
|
|
|
// All available admin scopes
|
|
|
|
const (
|
|
|
|
// Social moderation over the chat and forums.
|
|
|
|
// - Chat: have operator controls in the chat room
|
|
|
|
// - Forum: ability to edit and delete user posts
|
|
|
|
// - Photo: omniscient view of all gallery photos, can edit/delete photos
|
|
|
|
// - Inner circle: ability to remove users from it
|
|
|
|
ScopeChatModerator = "social.moderator.chat"
|
|
|
|
ScopeForumModerator = "social.moderator.forum"
|
|
|
|
ScopePhotoModerator = "social.moderator.photo"
|
|
|
|
ScopeCircleModerator = "social.moderator.inner-circle"
|
|
|
|
|
|
|
|
// Certification photo management
|
|
|
|
// - Approve: ability to respond to pending certification pics
|
|
|
|
// - List: paginate thru all approved or rejected photos
|
|
|
|
// - View: inspect specific user photos
|
|
|
|
ScopeCertificationApprove = "certification.approve"
|
|
|
|
ScopeCertificationList = "certification.list"
|
|
|
|
ScopeCertificationView = "certification.view"
|
|
|
|
|
|
|
|
// Website administration
|
|
|
|
// - Forum: ability to manage available forums
|
|
|
|
// - Scopes: ability to manage admin groups & scopes
|
2023-08-17 05:09:04 +00:00
|
|
|
// - Maintenance mode
|
2023-08-02 03:39:48 +00:00
|
|
|
ScopeForumAdmin = "admin.forum.manage"
|
|
|
|
ScopeAdminScopeAdmin = "admin.scope.manage"
|
2023-08-17 05:09:04 +00:00
|
|
|
ScopeMaintenance = "admin.maintenance"
|
2023-08-02 03:39:48 +00:00
|
|
|
|
|
|
|
// User account admin
|
|
|
|
// - Impersonate: ability to log in as a user account
|
|
|
|
// - Ban: ability to ban/unban users
|
|
|
|
// - Delete: ability to delete user accounts
|
|
|
|
ScopeUserImpersonate = "admin.user.impersonate"
|
|
|
|
ScopeUserBan = "admin.user.ban"
|
|
|
|
ScopeUserPromote = "admin.user.promote"
|
|
|
|
ScopeUserDelete = "admin.user.delete"
|
|
|
|
|
2023-08-17 05:09:04 +00:00
|
|
|
// Admins with this scope can not be blocked by users.
|
|
|
|
ScopeUnblockable = "admin.unblockable"
|
|
|
|
|
2023-08-02 03:39:48 +00:00
|
|
|
// Special scope to mark an admin automagically in the Inner Circle
|
|
|
|
ScopeIsInnerCircle = "admin.override.inner-circle"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Number of expected scopes for unit test and validation.
|
|
|
|
const QuantityAdminScopes = 14
|
|
|
|
|
|
|
|
// The specially named Superusers group.
|
|
|
|
const AdminGroupSuperusers = "Superusers"
|
|
|
|
|
|
|
|
// ListAdminScopes returns the listing of all available admin scopes.
|
|
|
|
func ListAdminScopes() []string {
|
|
|
|
return []string{
|
|
|
|
ScopeChatModerator,
|
|
|
|
ScopeForumModerator,
|
|
|
|
ScopePhotoModerator,
|
|
|
|
ScopeCircleModerator,
|
|
|
|
ScopeCertificationApprove,
|
|
|
|
ScopeCertificationList,
|
|
|
|
ScopeCertificationView,
|
|
|
|
ScopeForumAdmin,
|
|
|
|
ScopeAdminScopeAdmin,
|
|
|
|
ScopeUserImpersonate,
|
|
|
|
ScopeUserBan,
|
|
|
|
ScopeUserDelete,
|
|
|
|
ScopeUserPromote,
|
2023-08-17 05:09:04 +00:00
|
|
|
ScopeUnblockable,
|
2023-08-02 03:39:48 +00:00
|
|
|
ScopeIsInnerCircle,
|
|
|
|
}
|
|
|
|
}
|