perm

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Code generated from models.yml DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasOrganizationManagementLevel

func HasOrganizationManagementLevel(ctx context.Context, ds *datastore.Request, userID int, level OrganizationManagementLevel) (bool, error)

HasOrganizationManagementLevel returns true if the user has the level or a higher level

Types

type FQField

type FQField struct {
	Collection string
	ID         int
	Field      string
}

FQField contains all parts of a fqfield.

func ParseFQField

func ParseFQField(fqfield string) (FQField, error)

ParseFQField creates an FQField object from a fqfield string.

func (FQField) FQID

func (fqfield FQField) FQID() string

FQID returns the fqid representation of the fqfiedl.

func (FQField) String

func (fqfield FQField) String() string

type MeetingPermission

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

MeetingPermission is a cache for different Permission objects for each meeting.

Can be used if fields from different meetings are checked.

func NewMeetingPermission

func NewMeetingPermission(ds *datastore.Request, uid int) *MeetingPermission

NewMeetingPermission initializes a new MeetingPermission.

func (MeetingPermission) Meeting

func (p MeetingPermission) Meeting(ctx context.Context, meetingID int) (*Permission, error)

Meeting returns the permission object for the meeting.

func (MeetingPermission) UserID

func (p MeetingPermission) UserID() int

UserID returns the user id the object was initialized with.

type OrganizationManagementLevel

type OrganizationManagementLevel string

OrganizationManagementLevel are possible values from user/organization_management_level

const (
	OMLNone                  OrganizationManagementLevel = ""
	OMLSuperadmin            OrganizationManagementLevel = "superadmin"
	OMLCanManageOrganization OrganizationManagementLevel = "can_manage_organization"
	OMLCanManageUsers        OrganizationManagementLevel = "can_manage_users"
)

Organization management levels

type Permission

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

Permission holds the information which permissions and groups a user has.

func New

func New(ctx context.Context, ds *datastore.Request, userID, meetingID int) (*Permission, error)

New creates a new Permission object for a user in a specific meeting.

If the user is not a member of the meeting, nil is returned.

func (*Permission) Has

func (p *Permission) Has(perm TPermission) bool

Has returns true, if the permission object contains the given permissions.

func (*Permission) InGroup

func (p *Permission) InGroup(gid int) bool

InGroup returns true, if the user is in the given group (by group_id).

func (*Permission) IsAdmin

func (p *Permission) IsAdmin() bool

IsAdmin returns true, if the user is a meeting admin.

type TPermission

type TPermission string

TPermission is a type of all valid permission strings.

const (
	AgendaItemCanManage             TPermission = "agenda_item.can_manage"
	AgendaItemCanSee                TPermission = "agenda_item.can_see"
	AgendaItemCanSeeInternal        TPermission = "agenda_item.can_see_internal"
	AssignmentCanManage             TPermission = "assignment.can_manage"
	AssignmentCanNominateOther      TPermission = "assignment.can_nominate_other"
	AssignmentCanNominateSelf       TPermission = "assignment.can_nominate_self"
	AssignmentCanSee                TPermission = "assignment.can_see"
	ChatCanManage                   TPermission = "chat.can_manage"
	ListOfSpeakersCanBeSpeaker      TPermission = "list_of_speakers.can_be_speaker"
	ListOfSpeakersCanManage         TPermission = "list_of_speakers.can_manage"
	ListOfSpeakersCanSee            TPermission = "list_of_speakers.can_see"
	MediafileCanManage              TPermission = "mediafile.can_manage"
	MediafileCanSee                 TPermission = "mediafile.can_see"
	MeetingCanManageLogosAndFonts   TPermission = "meeting.can_manage_logos_and_fonts"
	MeetingCanManageSettings        TPermission = "meeting.can_manage_settings"
	MeetingCanSeeAutopilot          TPermission = "meeting.can_see_autopilot"
	MeetingCanSeeFrontpage          TPermission = "meeting.can_see_frontpage"
	MeetingCanSeeHistory            TPermission = "meeting.can_see_history"
	MeetingCanSeeLivestream         TPermission = "meeting.can_see_livestream"
	MotionCanCreate                 TPermission = "motion.can_create"
	MotionCanCreateAmendments       TPermission = "motion.can_create_amendments"
	MotionCanForwardIntoThisMeeting TPermission = "motion.can_forward_into_this_meeting"
	MotionCanManage                 TPermission = "motion.can_manage"
	MotionCanManageMetadata         TPermission = "motion.can_manage_metadata"
	MotionCanManagePolls            TPermission = "motion.can_manage_polls"
	MotionCanSee                    TPermission = "motion.can_see"
	MotionCanSeeInternal            TPermission = "motion.can_see_internal"
	MotionCanSupport                TPermission = "motion.can_support"
	PollCanManage                   TPermission = "poll.can_manage"
	ProjectorCanManage              TPermission = "projector.can_manage"
	ProjectorCanSee                 TPermission = "projector.can_see"
	TagCanManage                    TPermission = "tag.can_manage"
	UserCanManage                   TPermission = "user.can_manage"
	UserCanManagePresence           TPermission = "user.can_manage_presence"
	UserCanSee                      TPermission = "user.can_see"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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