Problem/Motivation

Add a new permission assign own roles to administer the roles for your own account.

Remaining tasks

  • Write code
  • Add a test
  • Add an upgrade path for BC.

Data model changes

* A new permission is added. All users that currently uses one of the permissions provided by the Role Delegation module (assign all roles or assign {role} role) should be able to assign the roles for it's own user for BC.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

visabhishek created an issue. See original summary.

visabhishek’s picture

Status: Active » Needs review
FileSize
1.28 KB

I am providing a patch to add a new permission.

Status: Needs review » Needs work

The last submitted patch, 2: add_a_new_permission-2736047-2.patch, failed testing.

visabhishek’s picture

I think we have to update test-cases accordingly.

benjy’s picture

So the purpose of this is to prevent users from updating their own account even though they can change roles on other accounts? Seems reasonable to me, will need some new tests and probably an upgrade path as well since that will change the default behaviour.

ckaotik’s picture

This does indeed sound sensible. I'd rename the permission into assign own roles though, to match the naming core uses :)

Prashant.c’s picture

Status: Needs work » Needs review
FileSize
1.28 KB

Making the change suggested by #6.

Status: Needs review » Needs work

The last submitted patch, 7: add_a_new_permission-2736047-7.patch, failed testing. View results

cmseasy’s picture

Is it possible to make a Drupal 7 version of this patch?

Prashant.c’s picture

@cmseasy

In my opinion that should be done in separate issue specifically for Drupal 7.

JeroenT’s picture

Issue tags: +Needs tests
+++ b/role_delegation.permissions.yml
@@ -5,3 +5,7 @@ assign all roles:
+allow own roles:

as @ckaotik mentioned, the permissions should be renamed to assign own roles to match core.

JeroenT’s picture

Title: Add a new permission for "allow yourself" » Add a new permission "assign own roles"
Issue summary: View changes
Related issues: +#1233684: Add a new permission or hide the tab
JeroenT’s picture

Status: Needs work » Closed (works as designed)

I created #3057858: Role Delegation integration which let role_delegation and userprotect work together. Userprotect is a dedicated issue which such behavior, so I would suggest using that module. When that issue gets committed, this feature will no longer be necessary.

JeroenT’s picture