Documentation ¶
Index ¶
- Variables
- type ProjectAuthZ
- type ProjectAuthZBasic
- func (a *ProjectAuthZBasic) CanArchiveProject(ctx context.Context, curUser model.User, project *projectv1.Project) error
- func (a *ProjectAuthZBasic) CanCreateProject(ctx context.Context, curUser model.User, ...) error
- func (a *ProjectAuthZBasic) CanDeleteProject(ctx context.Context, curUser model.User, project *projectv1.Project) error
- func (a *ProjectAuthZBasic) CanGetProject(ctx context.Context, curUser model.User, project *projectv1.Project) error
- func (a *ProjectAuthZBasic) CanMoveProject(ctx context.Context, curUser model.User, project *projectv1.Project, ...) error
- func (a *ProjectAuthZBasic) CanMoveProjectExperiments(ctx context.Context, curUser model.User, exp *model.Experiment, ...) error
- func (a *ProjectAuthZBasic) CanSetProjectDescription(ctx context.Context, curUser model.User, project *projectv1.Project) error
- func (a *ProjectAuthZBasic) CanSetProjectName(ctx context.Context, curUser model.User, project *projectv1.Project) error
- func (a *ProjectAuthZBasic) CanSetProjectNotes(ctx context.Context, curUser model.User, project *projectv1.Project) error
- func (a *ProjectAuthZBasic) CanUnarchiveProject(ctx context.Context, curUser model.User, project *projectv1.Project) error
Constants ¶
This section is empty.
Variables ¶
var AuthZProvider authz.AuthZProviderType[ProjectAuthZ]
AuthZProvider providers ProjectAuthZ implementations.
Functions ¶
This section is empty.
Types ¶
type ProjectAuthZ ¶
type ProjectAuthZ interface { // GET /api/v1/projects/:project_id CanGetProject(ctx context.Context, curUser model.User, project *projectv1.Project) error // POST /api/v1/workspaces/:workspace_id/projects CanCreateProject( ctx context.Context, curUser model.User, targetWorkspace *workspacev1.Workspace, ) error // POST /api/v1/projects/:project_id/notes // PUT /api/v1/projects/:project_id/notes CanSetProjectNotes(ctx context.Context, curUser model.User, project *projectv1.Project) error // PATCH /api/v1/projects/:project_id CanSetProjectName(ctx context.Context, curUser model.User, project *projectv1.Project) error CanSetProjectDescription( ctx context.Context, curUser model.User, project *projectv1.Project, ) error // DELETE /api/v1/projects/:project_id CanDeleteProject( ctx context.Context, curUser model.User, targetProject *projectv1.Project, ) error // POST /api/v1/projects/:project_id/move CanMoveProject(ctx context.Context, curUser model.User, project *projectv1.Project, from, to *workspacev1.Workspace) error // POST /api/v1/experiments/:experiment_id/move CanMoveProjectExperiments(ctx context.Context, curUser model.User, exp *model.Experiment, from, to *projectv1.Project) error // POST /api/v1/projects/:project_id/archive CanArchiveProject(ctx context.Context, curUser model.User, project *projectv1.Project) error // POST /api/v1/projects/:project_id/unarchive CanUnarchiveProject(ctx context.Context, curUser model.User, project *projectv1.Project) error }
ProjectAuthZ is the interface for project authorization.
type ProjectAuthZBasic ¶
type ProjectAuthZBasic struct{}
ProjectAuthZBasic is classic OSS Determined authentication for projects.
func (*ProjectAuthZBasic) CanArchiveProject ¶
func (a *ProjectAuthZBasic) CanArchiveProject( ctx context.Context, curUser model.User, project *projectv1.Project, ) error
CanArchiveProject returns an error if a non admin isn't the owner of the project or workspace.
func (*ProjectAuthZBasic) CanCreateProject ¶
func (a *ProjectAuthZBasic) CanCreateProject( ctx context.Context, curUser model.User, willBeInWorkspace *workspacev1.Workspace, ) error
CanCreateProject always returns true and a nil error for basic auth.
func (*ProjectAuthZBasic) CanDeleteProject ¶
func (a *ProjectAuthZBasic) CanDeleteProject( ctx context.Context, curUser model.User, project *projectv1.Project, ) error
CanDeleteProject returns an error if a non admin isn't the owner of the project or workspace.
func (*ProjectAuthZBasic) CanGetProject ¶
func (a *ProjectAuthZBasic) CanGetProject( ctx context.Context, curUser model.User, project *projectv1.Project, ) error
CanGetProject always return true and a nil error for basic auth.
func (*ProjectAuthZBasic) CanMoveProject ¶
func (a *ProjectAuthZBasic) CanMoveProject( ctx context.Context, curUser model.User, project *projectv1.Project, from, to *workspacev1.Workspace, ) error
CanMoveProject returns an error if the user isn't a admin or owner of a project.
func (*ProjectAuthZBasic) CanMoveProjectExperiments ¶
func (a *ProjectAuthZBasic) CanMoveProjectExperiments( ctx context.Context, curUser model.User, exp *model.Experiment, from, to *projectv1.Project, ) error
CanMoveProjectExperiments returns an error if the user isn't a admin or owner of a project.
func (*ProjectAuthZBasic) CanSetProjectDescription ¶
func (a *ProjectAuthZBasic) CanSetProjectDescription( ctx context.Context, curUser model.User, project *projectv1.Project, ) error
CanSetProjectDescription returns an error if a non admin isn't the owner of the project or workspace.
func (*ProjectAuthZBasic) CanSetProjectName ¶
func (a *ProjectAuthZBasic) CanSetProjectName( ctx context.Context, curUser model.User, project *projectv1.Project, ) error
CanSetProjectName returns an error if a non admin isn't the owner of the project or workspace.
func (*ProjectAuthZBasic) CanSetProjectNotes ¶
func (a *ProjectAuthZBasic) CanSetProjectNotes( ctx context.Context, curUser model.User, project *projectv1.Project, ) error
CanSetProjectNotes always returns nil for basic auth.
func (*ProjectAuthZBasic) CanUnarchiveProject ¶
func (a *ProjectAuthZBasic) CanUnarchiveProject( ctx context.Context, curUser model.User, project *projectv1.Project, ) error
CanUnarchiveProject returns an error if the user isn't the owner of the project or workspace.