1

I've been experimenting with Drupal 7 quite a bit and have a doubt with User Roles.

  1. In the application that I am trying to create, There are 5 roles for users and there is one role ( say E ), which when chosen, the others ( A, B, C, D ) will grey out or can't be chosen.

In simple terms,

if( $role chosen == A || B || C || D ) { Options to choose other Roles are available including the Role 'E' }

if( $role chosen == E ) { Other Roles are blocked and can't be chosen }

Is there any possible way I can achieve it ?

2 . I also have another doubt about the statuses of the Roles. Can I Flag users in anyway apart from the default 'Status' ? Also, if that is not possible, is there anyway for me to create a new Status ?

svabhishek
  • 83
  • 1
  • 7

1 Answers1

1

For the point #1, you can achieve that using jQuery. You can use the code in this answer to get you started.

For point #2, YES you can flag users. You can add your own filter as a field from admin/config/people/accounts/fields and use Field Permissions module to block users from accessing this field.

Update: The steps in details:

1- Go to http://[YOUR_SITE.COM]/admin/config/people/accounts/fields

2- Under to Add new field, enter the new field name and under Type of data to store choose List (text). Then click Save

3- In Field settings page, enter the Allowed values list (Speaker, Attendee, ...)

4- If Field Permissions module is enabled, you should see Field visibility and permissions in the bottom of the page. Choose Custom permissions and check the roles that can view/edit this field. Then click Save settings.

Hope this helps... Muhammad.

Community
  • 1
  • 1
Muhammad Reda
  • 26,379
  • 14
  • 93
  • 105
  • Hello Muhammad .. I will try the JQuery part, but my second question was not about Roles, it was more about User Statuses. Say there is a meeting or an event and I want to mark the attendees or speakers with a status "Attendee" or "Speaker" .. Can I do that ? – svabhishek Jul 04 '12 at 20:31
  • I have updated my answer. Kindly tell me if further help is needed... -Muhammad. – Muhammad Reda Jul 05 '12 at 07:10
  • Hello Muhammad .. That was quite a lot and was just what I wanted .. :) Thanks for the instant response :) You saved me :) :) – svabhishek Jul 08 '12 at 19:58
  • Really glad it helped :). Kindly mark the answer as the correct one... -Muhammad. – Muhammad Reda Jul 08 '12 at 20:51