website/pkg/config/admin_scopes.go
2023-08-16 22:09:04 -07:00

73 lines
2.3 KiB
Go

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
// - Maintenance mode
ScopeForumAdmin = "admin.forum.manage"
ScopeAdminScopeAdmin = "admin.scope.manage"
ScopeMaintenance = "admin.maintenance"
// 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"
// Admins with this scope can not be blocked by users.
ScopeUnblockable = "admin.unblockable"
// 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,
ScopeUnblockable,
ScopeIsInnerCircle,
}
}