services

package
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 4, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PermissionService

type PermissionService struct {
	// contains filtered or unexported fields
}

PermissionService answers the agent ticket/queue permission checks of the ticket APIs. It uses the same effective-permission model as the queue access middleware (service.QueueAccessService): a permission on a queue's group comes from group_user or from a valid role (role_user -> group_role), 'rw' supersedes every granular key, and members of the admin group have full access.

func NewPermissionService

func NewPermissionService(db *sql.DB) *PermissionService

NewPermissionService creates a new permission service.

func (*PermissionService) CanAddNote

func (s *PermissionService) CanAddNote(userID int, ticketID int64) (bool, error)

CanAddNote checks if a user can add notes to tickets in a queue. Requires 'note' or 'rw' permission.

func (*PermissionService) CanBeOwner

func (s *PermissionService) CanBeOwner(userID int, queueID int) (bool, error)

CanBeOwner checks if a user can be assigned as owner in a queue. Requires 'owner' or 'rw' permission.

func (*PermissionService) CanChangePriority

func (s *PermissionService) CanChangePriority(userID int, ticketID int64) (bool, error)

CanChangePriority checks if a user can change priority of tickets in a queue. Requires 'priority' or 'rw' permission.

func (*PermissionService) CanCreate

func (s *PermissionService) CanCreate(userID int, queueID int) (bool, error)

CanCreate checks if a user can create tickets in a queue. Requires 'create' or 'rw' permission.

func (*PermissionService) CanMoveInto

func (s *PermissionService) CanMoveInto(userID int, queueID int) (bool, error)

CanMoveInto checks if a user can move tickets into a queue. Requires 'move_into' or 'rw' permission.

func (*PermissionService) CanReadQueue

func (s *PermissionService) CanReadQueue(userID int, queueID int) (bool, error)

CanReadQueue checks if a user has at least read (ro) permission on a specific queue.

func (*PermissionService) CanWriteQueue

func (s *PermissionService) CanWriteQueue(userID int, queueID int) (bool, error)

CanWriteQueue checks if a user has write (rw) permission on a specific queue.

func (*PermissionService) CanWriteTicket

func (s *PermissionService) CanWriteTicket(userID int, ticketID int64) (bool, error)

CanWriteTicket checks if a user has write (rw) permission on a ticket's queue.

func (*PermissionService) GetUserQueuePermissions

func (s *PermissionService) GetUserQueuePermissions(userID int) (map[int]string, error)

GetUserQueuePermissions returns every valid queue the user holds any effective permission on. Map key is queue_id, value is 'rw' when the user has rw on the queue's group, otherwise one of the granular keys held.

func (*PermissionService) HasPermission

func (s *PermissionService) HasPermission(userID int, queueID int, permKey string) (bool, error)

HasPermission checks if a user has a specific permission on a queue.

func (*PermissionService) HasTicketPermission

func (s *PermissionService) HasTicketPermission(userID int, ticketID int64, permKey string) (bool, error)

HasTicketPermission checks if a user has a specific permission on a ticket's queue.

Directories

Path Synopsis
Package acl provides the ACL (Access Control List) execution engine.
Package acl provides the ACL (Access Control List) execution engine.
Package escalation keeps the OTRS ticket escalation index (ticket.escalation_* columns) up to date and raises the OTRS escalation events.
Package escalation keeps the OTRS ticket escalation index (ticket.escalation_* columns) up to date and raises the OTRS escalation events.
Package genericagent provides the Generic Agent execution engine.
Package genericagent provides the Generic Agent execution engine.
Package scheduler provides task scheduling and job management.
Package scheduler provides task scheduling and job management.
Package ticket provides ticket domain models and business logic.
Package ticket provides ticket domain models and business logic.
Package ticketattributerelations provides management of ticket attribute relationships.
Package ticketattributerelations provides management of ticket attribute relationships.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL