Files
libredesk/internal/authz/models/models.go
T
Abhinav Raut 87c14aa15d feat: Macros, macros not completely replace canned responses as they do the same job as canned repsonse.
- tiptap editor fixes for hardlines.
- set app font to jakarta, fix shadcn components having a different font.
- UI improvements on /admin
- UI improvements on inbox tab.
2025-01-17 04:57:01 +05:30

103 lines
3.0 KiB
Go

package models
const (
// Conversation
PermConversationsReadAll = "conversations:read_all"
PermConversationsReadUnassigned = "conversations:read_unassigned"
PermConversationsReadAssigned = "conversations:read_assigned"
PermConversationsReadTeamInbox = "conversations:read_team_inbox"
PermConversationsRead = "conversations:read"
PermConversationsUpdateUserAssignee = "conversations:update_user_assignee"
PermConversationsUpdateTeamAssignee = "conversations:update_team_assignee"
PermConversationsUpdatePriority = "conversations:update_priority"
PermConversationsUpdateStatus = "conversations:update_status"
PermConversationsUpdateTags = "conversations:update_tags"
PermMessagesRead = "messages:read"
PermMessagesWrite = "messages:write"
// View
PermViewManage = "view:manage"
// Status
PermStatusManage = "status:manage"
// Tags
PermTagsManage = "tags:manage"
// Macros
PermMacrosManage = "macros:manage"
// Users
PermUsersManage = "users:manage"
// Teams
PermTeamsManage = "teams:manage"
// Automations
PermAutomationsManage = "automations:manage"
// Inboxes
PermInboxesManage = "inboxes:manage"
// Roles
PermRolesManage = "roles:manage"
// Templates
PermTemplatesManage = "templates:manage"
// Reports
PermReportsManage = "reports:manage"
// Business Hours
PermBusinessHoursManage = "business_hours:manage"
// SLA
PermSLAManage = "sla:manage"
// General Settings
PermGeneralSettingsManage = "general_settings:manage"
// Notification Settings
PermNotificationSettingsManage = "notification_settings:manage"
// OpenID Connect SSO
PermOIDCManage = "oidc:manage"
)
var validPermissions = map[string]struct{}{
PermConversationsReadAll: {},
PermConversationsReadUnassigned: {},
PermConversationsReadAssigned: {},
PermConversationsReadTeamInbox: {},
PermConversationsRead: {},
PermConversationsUpdateUserAssignee: {},
PermConversationsUpdateTeamAssignee: {},
PermConversationsUpdatePriority: {},
PermConversationsUpdateStatus: {},
PermConversationsUpdateTags: {},
PermMessagesRead: {},
PermMessagesWrite: {},
PermViewManage: {},
PermStatusManage: {},
PermTagsManage: {},
PermMacrosManage: {},
PermUsersManage: {},
PermTeamsManage: {},
PermAutomationsManage: {},
PermInboxesManage: {},
PermRolesManage: {},
PermTemplatesManage: {},
PermReportsManage: {},
PermBusinessHoursManage: {},
PermSLAManage: {},
PermGeneralSettingsManage: {},
PermNotificationSettingsManage: {},
PermOIDCManage: {},
}
// IsValidPermission returns true if it's a valid permission.
func IsValidPermission(permission string) bool {
_, exists := validPermissions[permission]
return exists
}