Documentation ¶
Index ¶
- type CasePermissions
- type ExecutionPermissions
- type Label
- type MemberPermissions
- type Permissions
- type Project
- func (p Project) AddMember(member id.ActorID)
- func (p Project) GetLabelByName(labelName string) (Label, error)
- func (p *Project) GetPermissions(u *user.User) Permissions
- func (p Project) ID() id.ProjectID
- func (p *Project) IsOwner(u *user.User) bool
- func (p Project) ItemName() string
- func (p Project) ItemVisibility() visibility.Visibility
- func (p Project) RemoveMember(member *user.User)
- type Role
- type RoleName
- type SequencePermissions
- type SettingsPermissions
- type UserMembership
- type Variant
- type Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CasePermissions ¶ added in v1.0.0
type CasePermissions struct { CreateCase bool EditCase bool DeleteCase bool DuplicateCase bool AssignCase bool }
CasePermissions are the permissions affecting the cases in a project
type ExecutionPermissions ¶ added in v1.0.0
type ExecutionPermissions struct {
Execute bool
}
ExecutionPermissions are the permissions affecting the execution
type MemberPermissions ¶ added in v1.0.0
type MemberPermissions struct {
EditMembers bool
}
MemberPermissions are the permissions affecting the members in a project
type Permissions ¶ added in v1.0.0
type Permissions struct { ExecutionPermissions CasePermissions SequencePermissions MemberPermissions SettingsPermissions }
Permissions are all permissions that a user can have in a project
type Project ¶
type Project struct { Name string Description string Visibility visibility.Visibility CreationDate time.Time Owner id.ActorID Variants map[string]*Variant Labels []Label UserMembers map[id.ActorID]UserMembership Roles map[RoleName]*Role }
The Project struct contains information used to describe a project in the system
func NewProject ¶
func NewProject(name string, owner id.ActorID, description string, visibility visibility.Visibility) Project
NewProject creates a new project
func (Project) AddMember ¶ added in v1.0.0
AddMember adds the given user to the project It creates a UserMembership with the role "Tester".
func (Project) GetLabelByName ¶ added in v1.1.0
GetLabelByName gets a label of a project by name
func (*Project) GetPermissions ¶ added in v1.0.0
func (p *Project) GetPermissions(u *user.User) Permissions
GetPermissions returns the permissions of a user in a project. Returns an empty permission struct if the user does not exist in the project.
func (*Project) IsOwner ¶ added in v1.0.0
IsOwner checks whether the user is owner of the project. Returns false if the project or the user is nil or if the user is not the owner.
func (Project) ItemVisibility ¶
func (p Project) ItemVisibility() visibility.Visibility
ItemVisibility returns a projects visibility
func (Project) RemoveMember ¶ added in v1.0.0
RemoveMember removes the given user of the project
type Role ¶ added in v1.0.0
type Role struct { Name RoleName Permissions Permissions }
A Role defines the permissions a user has in a project. It has a name and permissions.
type SequencePermissions ¶ added in v1.0.0
type SequencePermissions struct { CreateSequence bool EditSequence bool DeleteSequence bool DuplicateSequence bool AssignSequence bool }
SequencePermissions are the permissions affecting the sequences in a project
type SettingsPermissions ¶ added in v1.0.0
type SettingsPermissions struct { EditProject bool // Change name, description, image, visibility DeleteProject bool EditPermissions bool }
SettingsPermissions are the permissions affecting the settings of a project
type UserMembership ¶ added in v1.0.0
UserMembership contains information about the membership of a user in a project
func NewUserMembership ¶ added in v1.0.0
func NewUserMembership(u id.ActorID) UserMembership
NewUserMembership creates a new membership with the user. The role of the member is set to tester by default. Returns a UserMembership.