Fixed permission for org admins to accept/reject join requests
This commit is contained in:
@@ -51,12 +51,6 @@ class OrganisationPermissions extends BaseSeed
|
||||
'conditions' => 'always()',
|
||||
'description' => 'Create a new organisation.',
|
||||
]),
|
||||
'register_organisation' => new Permission([
|
||||
'slug' => 'register_organisation',
|
||||
'name' => 'Register organisation',
|
||||
'conditions' => 'always()',
|
||||
'description' => 'Register a new organisation. May optionally require approval.',
|
||||
]),
|
||||
'view_organisation_field' => new Permission([
|
||||
'slug' => 'view_organisation_field',
|
||||
'name' => 'View organisation',
|
||||
@@ -75,18 +69,6 @@ class OrganisationPermissions extends BaseSeed
|
||||
'conditions' => "always()",
|
||||
'description' => 'View members of any organisation.',
|
||||
]),
|
||||
'view_organisation_field_own' => new Permission([
|
||||
'slug' => 'view_organisation_field',
|
||||
'name' => 'View own organisation',
|
||||
'conditions' => "is_organisation_member(self.id,organisation.id) && in(property,['name','slug','description','members'])",
|
||||
'description' => 'View certain properties of own organisation.',
|
||||
]),
|
||||
'update_organisation_field_own' => new Permission([
|
||||
'slug' => 'update_organisation_field',
|
||||
'name' => 'Update own organisation',
|
||||
'conditions' => "is_organisation_admin(self.id,organisation.id) && subset(fields,['name','slug','description','members'])",
|
||||
'description' => 'Edit basic properties of own organisation.',
|
||||
]),
|
||||
'update_organisation_field' => new Permission([
|
||||
'slug' => 'update_organisation_field',
|
||||
'name' => 'Edit organisation',
|
||||
@@ -105,18 +87,6 @@ class OrganisationPermissions extends BaseSeed
|
||||
'conditions' => 'always()',
|
||||
'description' => 'Merge two organisations together, including all the members.',
|
||||
]),
|
||||
'leave_organisation' => new Permission([
|
||||
'slug' => 'leave_organisation',
|
||||
'name' => 'Leave organisation',
|
||||
'conditions' => 'always()',
|
||||
'description' => 'Allows members to leave organisations.',
|
||||
]),
|
||||
'join_organisation' => new Permission([
|
||||
'slug' => 'join_organisation',
|
||||
'name' => 'Join organisation',
|
||||
'conditions' => 'always()',
|
||||
'description' => 'Allows members to join organisations.',
|
||||
]),
|
||||
'delete_organisation' => new Permission([
|
||||
'slug' => 'delete_organisation',
|
||||
'name' => 'Delete organisation',
|
||||
@@ -135,6 +105,44 @@ class OrganisationPermissions extends BaseSeed
|
||||
'conditions' => 'always()',
|
||||
'description' => 'Permenently delete an organisation.',
|
||||
]),
|
||||
|
||||
'register_organisation' => new Permission([
|
||||
'slug' => 'register_organisation',
|
||||
'name' => 'Register organisation',
|
||||
'conditions' => 'always()',
|
||||
'description' => 'Register a new organisation. May optionally require approval.',
|
||||
]),
|
||||
'join_organisation' => new Permission([
|
||||
'slug' => 'join_organisation',
|
||||
'name' => 'Join organisation',
|
||||
'conditions' => 'always()',
|
||||
'description' => 'Allows members to join organisations.',
|
||||
]),
|
||||
'leave_organisation' => new Permission([
|
||||
'slug' => 'leave_organisation',
|
||||
'name' => 'Leave organisation',
|
||||
'conditions' => 'always()',
|
||||
'description' => 'Allows members to leave organisations.',
|
||||
]),
|
||||
'view_organisation_field_own' => new Permission([
|
||||
'slug' => 'view_organisation_field',
|
||||
'name' => 'View own organisation',
|
||||
'conditions' => "is_organisation_member(self.id,organisation.id) && in(property,['name','slug','description','members'])",
|
||||
'description' => 'View certain properties of own organisation.',
|
||||
]),
|
||||
'update_organisation_field_own' => new Permission([
|
||||
'slug' => 'update_organisation_field',
|
||||
'name' => 'Update own organisation',
|
||||
'conditions' => "is_organisation_admin(self.id,organisation.id) && subset(fields,['name','slug','description','members'])",
|
||||
'description' => 'Edit basic properties of own organisation.',
|
||||
]),
|
||||
'accept_organisation_join_request' => new Permission([
|
||||
'slug' => 'accept_organisation_join_request',
|
||||
'name' => 'Accept/Reject join request',
|
||||
'conditions' => "is_organisation_admin(self.id,organisation.id)",
|
||||
'description' => 'Accept/Reject organisation join requests.',
|
||||
]),
|
||||
|
||||
'uri_organisation' => new Permission([
|
||||
'slug' => 'uri_organisation',
|
||||
'name' => 'View organisation',
|
||||
@@ -236,6 +244,7 @@ class OrganisationPermissions extends BaseSeed
|
||||
$permissions['join_organisation']->id,
|
||||
$permissions['leave_organisation']->id,
|
||||
$permissions['register_organisation']->id,
|
||||
$permissions['accept_organisation_join_request']->id,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user