project

package
v1.3.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2018 License: GPL-3.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 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 Label added in v0.9.0

type Label struct {
	Name        string
	Description string
	Color       string
}

A Label is used to group tests

func NewLabel added in v0.9.0

func NewLabel(name, description, color string) Label

NewLabel creates a new label

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

Permissions are all permissions that a user can have in a project

type Project

type Project struct {
	Name         string
	Description  string
	Image        string
	Visibility   visibility.Visibility
	CreationDate time.Time
	Owner        id.ActorID
	Versions     map[string]*Version
	Labels       []Label
	UserMembers  map[id.ActorID]UserMembership
	Roles        map[RoleName]*Role
}

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

func (p Project) AddMember(member id.ActorID, role RoleName)

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

func (p Project) GetLabelByName(labelName string) (Label, error)

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) ID

func (p Project) ID() id.ProjectID

ID returns a projects id

func (*Project) IsOwner added in v1.0.0

func (p *Project) IsOwner(u *user.User) bool

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) ItemName

func (p Project) ItemName() string

ItemName returns a projects name

func (Project) ItemVisibility

func (p Project) ItemVisibility() visibility.Visibility

ItemVisibility returns a projects visibility

func (Project) RemoveMember added in v1.0.0

func (p Project) RemoveMember(member *user.User)

RemoveMember removes the given user of the project

func (Project) UpdateMember added in v1.3.0

func (p Project) UpdateMember(member *user.User, role RoleName)

updates the role of a member

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 RoleName added in v1.0.0

type RoleName string

A RoleName is the name of a role in a project

func (*RoleName) String added in v1.0.0

func (r *RoleName) String() string

String returns the RoleName as string

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

type UserMembership struct {
	User        id.ActorID
	Role        RoleName
	MemberSince time.Time
}

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

type Variant added in v0.8.0

type Variant struct {
	Name string
}

The Variant struct contains the name of a system under test variant

type Version added in v0.8.0

type Version struct {
	Name     string
	Variants []Variant
}

The Version struct represents a system under test version and the variants applicable to it

Jump to

Keyboard shortcuts

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