Documentation ¶
Index ¶
- func TestAssignmentInProjectNeeded(t *testing.T)
- func TestAssignmentInTaskNeeded(t *testing.T)
- func TestMain(m *testing.M)
- func TestVerifyAssignment(t *testing.T)
- func TestVerifyMembershipProject(t *testing.T)
- func TestVerifyMembershipTask(t *testing.T)
- func TestVerifyMembershipTasks(t *testing.T)
- func TestVerifyOwnership(t *testing.T)
- type PermissionStore
- func (s *PermissionStore) AssignmentInProjectNeeded(projectId string) (bool, error)
- func (s *PermissionStore) AssignmentInTaskNeeded(taskId string) (bool, error)
- func (s *PermissionStore) VerifyAssignment(taskId string, user string) error
- func (s *PermissionStore) VerifyMembershipProject(projectId string, user string) error
- func (s *PermissionStore) VerifyMembershipTask(taskId string, user string) error
- func (s *PermissionStore) VerifyMembershipTasks(taskIds []string, user string) error
- func (s *PermissionStore) VerifyOwnership(projectId string, user string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TestVerifyAssignment ¶
func TestVerifyOwnership ¶
Types ¶
type PermissionStore ¶
func Init ¶
func Init(tx *sql.Tx, logger *util.Logger) *PermissionStore
Init the permission store for the project and task table.
func (*PermissionStore) AssignmentInProjectNeeded ¶
func (s *PermissionStore) AssignmentInProjectNeeded(projectId string) (bool, error)
AssignmentInProjectNeeded determines whether a user needs to be assigned to tasks in this project.
func (*PermissionStore) AssignmentInTaskNeeded ¶
func (s *PermissionStore) AssignmentInTaskNeeded(taskId string) (bool, error)
AssignmentInTaskNeeded determines whether a user needs to be assigned to this task.
func (*PermissionStore) VerifyAssignment ¶
func (s *PermissionStore) VerifyAssignment(taskId string, user string) error
VerifyAssignment returns an error when the given user is not assigned to the given task.
func (*PermissionStore) VerifyMembershipProject ¶
func (s *PermissionStore) VerifyMembershipProject(projectId string, user string) error
VerifyMembershipProject checks if "user" is a member of the project "id".
func (*PermissionStore) VerifyMembershipTask ¶
func (s *PermissionStore) VerifyMembershipTask(taskId string, user string) error
VerifyMembershipTask checks if "user" is a member of the project, where the given task with "id" is in.
func (*PermissionStore) VerifyMembershipTasks ¶
func (s *PermissionStore) VerifyMembershipTasks(taskIds []string, user string) error
VerifyMembershipTask checks if "user" is a member of the projects, where the given tasks are in.
func (*PermissionStore) VerifyOwnership ¶
func (s *PermissionStore) VerifyOwnership(projectId string, user string) error
VerifyOwnership check if the given user is the owner of the given project.