Documentation ¶
Index ¶
- type CasePermissions
- type DisplayPermissions
- type ExecutionPermissions
- type GitlabProject
- type Integrations
- type Label
- type MemberPermissions
- type Permissions
- type Project
- func (p Project) AddMember(member id.ActorID, role RoleName)
- func (p Project) GetLabelByName(labelName string) (Label, error)
- func (p *Project) GetPermissions(u *user.User) Permissions
- func (p *Project) GetRole(u *user.User) *Role
- func (p Project) ID() id.ProjectID
- func (p *Project) IsOwner(u *user.User) bool
- func (p Project) RemoveMember(member *user.User)
- func (p Project) UpdateMember(member *user.User, role RoleName)
- type Role
- type RoleName
- type SequencePermissions
- type SettingsPermissions
- type TestLabel
- 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 DisplayPermissions ¶ added in v1.1.0
type DisplayPermissions struct {
DisplayProject bool
}
DisplayPermissions are the permissions to display elements in the project
type ExecutionPermissions ¶ added in v1.0.0
type ExecutionPermissions struct {
Execute bool
}
ExecutionPermissions are the permissions affecting the execution
type GitlabProject ¶
type GitlabProject struct { IsActive bool ID string // ID or url-encoded path of the project Token string // Token to access the project }
GitlabProject is the project in gitlab
type Integrations ¶
type Integrations struct {
GitlabProject GitlabProject
}
type Label ¶ added in v0.9.0
type Label struct { Id int64 // Foreign Key ----------| ProjectId int64 Name string Description string Color string TextColor string }
A Label is used to group tests
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 { DisplayPermissions ExecutionPermissions CasePermissions SequencePermissions MemberPermissions SettingsPermissions }
Permissions are all permissions that a user can have in a project
type Project ¶
type Project struct { Id int64 OwnerId int64 Name string Description string Image string Token string Visibility visibility.Visibility CreationDate time.Time Owner id.ActorID `xorm:"-"` Labels []*Label `xorm:"-"` Versions map[string]*Version `xorm:"-"` UserMembers map[id.ActorID]UserMembership `xorm:"-"` Roles map[RoleName]*Role `xorm:"-"` Integrations Integrations `xorm:"-"` }
The Project struct contains information used to describe a project in the system Image is a base64 encoded string
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 given role name.
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.
Every user can view public projects. Users that are a member of a public project have the permissions that are defined for his role.
Signed-In users can view internal projects. Users that are a member of an internal projects have the permissions that are defined for his role.
Users that are owner or members of a project can view a private project. Nobody else has access to these projects.
func (*Project) GetRole ¶ added in v1.7.0
GetRole returns the role of a user in a project. Returns nil if the user is nil or 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) 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, role RoleName) UserMembership
NewUserMembership creates a new membership with the user and the role. Returns a UserMembership.
func (UserMembership) UpdateRole ¶ added in v1.3.0
func (uM UserMembership) UpdateRole(role RoleName) UserMembership