[full-ci] Added a new role space editor without versions
This commit is contained in:
+24
@@ -43,6 +43,8 @@ const (
|
||||
RoleEditor = "editor"
|
||||
// RoleSpaceEditor grants editor permission on a space.
|
||||
RoleSpaceEditor = "spaceeditor"
|
||||
// RoleSpaceEditorWithoutVersions grants editor permission without list/restore versions on a space.
|
||||
RoleSpaceEditorWithoutVersions = "spaceeditor-without-versions"
|
||||
// RoleFileEditor grants editor permission on a single file.
|
||||
RoleFileEditor = "file-editor"
|
||||
// RoleCoowner grants co-owner permissions on a resource.
|
||||
@@ -272,6 +274,28 @@ func NewSpaceEditorRole() *Role {
|
||||
}
|
||||
}
|
||||
|
||||
// NewSpaceEditorWithoutVersionsRole creates an editor without list/restore versions role
|
||||
func NewSpaceEditorWithoutVersionsRole() *Role {
|
||||
return &Role{
|
||||
Name: RoleSpaceEditorWithoutVersions,
|
||||
cS3ResourcePermissions: &provider.ResourcePermissions{
|
||||
CreateContainer: true,
|
||||
Delete: true,
|
||||
GetPath: true,
|
||||
GetQuota: true,
|
||||
InitiateFileDownload: true,
|
||||
InitiateFileUpload: true,
|
||||
ListContainer: true,
|
||||
ListGrants: true,
|
||||
ListRecycle: true,
|
||||
Move: true,
|
||||
RestoreRecycleItem: true,
|
||||
Stat: true,
|
||||
},
|
||||
ocsPermissions: PermissionRead | PermissionCreate | PermissionWrite | PermissionDelete,
|
||||
}
|
||||
}
|
||||
|
||||
// NewFileEditorRole creates a file-editor role
|
||||
func NewFileEditorRole() *Role {
|
||||
p := PermissionRead | PermissionWrite
|
||||
|
||||
+13
@@ -102,3 +102,16 @@ func (BackchannelLogout) Unmarshal(v []byte) (interface{}, error) {
|
||||
err := json.Unmarshal(v, &e)
|
||||
return e, err
|
||||
}
|
||||
|
||||
// UserSignedIn is emitted when a user signs in
|
||||
type UserSignedIn struct {
|
||||
Executant *user.UserId
|
||||
Timestamp *types.Timestamp
|
||||
}
|
||||
|
||||
// Unmarshal to fulfill umarshaller interface
|
||||
func (UserSignedIn) Unmarshal(v []byte) (interface{}, error) {
|
||||
e := UserSignedIn{}
|
||||
err := json.Unmarshal(v, &e)
|
||||
return e, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user