hi,

In authenticated user role how to create a role.
i.e., role in a role

Iam having a manager role in that i want to create a team leader role how can i do this.

Team leader will have different permissions and manager will have different permissions
first how to create team leader role in manager role?

Can any one guide me in this case

Thanks in advance

Comments

pobster’s picture

Just checking that it's not April Fools day any more... Nope, doesn't seem to be...

...Admin -> ROLES -> well, there's a shock -> ADD ROLE.

As for your quite frankly weird understanding of having a 'role within a role', just assign both roles to a user...

Pobster

Jahnavi’s picture

hi,

thanks for ur reply.

I know how to create a individual role but i want to create a role in already existing role ex:iam having a role named "Manager"in this i want "TeamLeader" role.not separately.

Iam having a requirement.i.e.,

Iam having "Super coordinator" role as a top most role with all the permissions.
Then "Group Coordinator" role next to supercoordinator with some permissions(like he can't delete any of the document)
then comes "Contributor" role with least permissions.

Now ,
Iam having 3 super coordinators, 7 group coordinators , 10 contributors.

1st super coordinator will have 1st and 2nd group coordintors. not the others.what ever the data passed by the 1st and 2nd group coordinators must be seen only by the 1st super coordinator not by the other super coordinators.

at the same time ...............2nd super coordinator will have 3rd and 4th group coordintors. not the others.what ever the data passed by the 3rd and 4th group coordinators must be seen only by the 2st super coordinator not by the other super coordinators.

this goes on..................in this manner.
Then if that data is published by the particular super coordinator then only the other super coordinators can see the data(Published).

In the same way iam having contributors in group coordinators.

So i am having the requirement of roles in roles.

If this case can be done with any other way please guide me in that becoz iam new to drupal ,php.Just 15 days.So i dont't know any new modules.I have just got through "Organic Module" but it's dependent on the Groups,not the roles.

Do we have any module for this case i.e., roles?

Plaese guide me.

Thanks in Advance

Regards,
Anujahnavi

lauscherli’s picture

Why you would want to have a role in a role? I don't understand that. As long as you can set each role individually, why would you want that?
And if so: i think there's a module called 'role promote' that would assign users to new roles after they completed 'some task'/similar functionality you'll find in og-promote. But i think that's not what you're looking for.

Just create a new role (->Administer -> User management -> Roles -> add Roles)

After this you go to user permissions and set all the permissions you want for 'team-leader-role'. Note: you can assign different roles to a user; so you don't need to give all permissions of authenticated users again to the team-leader-role (while the role authenticated user is assigned automatically after registration), only the additional permissions are needed.

So you will have a new role 'team-leader' with more permissions than 'authenticated user'. If you need more functionality, check the role-related modules.

Jahnavi’s picture

hi,

thanks for ur reply.

Iam having a requirement.i.e.,

Iam having "Super coordinator" role as a top most role with all the permissions.
Then "Group Coordinator" role next to supercoordinator with some permissions(like he can't delete any of the document)
then comes "Contributor" role with least permissions.

Now ,
Iam having 3 super coordinators, 7 group coordinators , 10 contributors.

1st super coordinator will have 1st and 2nd group coordintors. not the others.what ever the data passed by the 1st and 2nd group coordinators must be seen only by the 1st super coordinator not by the other super coordinators.

at the same time ...............2nd super coordinator will have 3rd and 4th group coordintors. not the others.what ever the data passed by the 3rd and 4th group coordinators must be seen only by the 2st super coordinator not by the other super coordinators.

this goes on..................in this manner.
Then if that data is published by the particular super coordinator then only the other super coordinators can see the data(Published).

In the same way iam having contributors in group coordinators.

So i am having the requirement of roles in roles.

If this case can be done with any other way please guide me in that becoz iam new to drupal ,php.Just 15 days.So i dont't know any new modules.I have just got through "Organic Module" but it's dependent on the Groups,not the roles.

Do we have any module for this case i.e., roles?

Plaese guide me.

Thanks in Advance

Regards,
Anujahnavi

pobster’s picture

As I mentioned above a user can be assigned, two, three, however many roles you want. The users permissions are taken from ALL the roles they're assigned, so you'd create a 'base' role like say, 'co-ordinators' then you'd give that role the permissions you'd want all the users of that role group to share. Then for the 'sub-roles' as you put them, the ones with subtle differences to the others, you'd create a role for each of them with the extra permissions checked. This way you don't have to go checking absolutely everything for all the roles you define as the 'base' role you've created takes care of that.

I honestly don't know how to better explain that to you...

Pobster

Jahnavi’s picture

Hi,

Thanks for ur reply.

but iam not clear what u said.

anyway can u please tell me where the code is available for the roles.in which file.

In administer->user management->roles we have a button "AddRoles"
I want the code of that where the code is available .in which file of the drupal folder.
Please guide me.

Thanks in Advance

Anuja

pobster’s picture

I give up, you're just not listening...

Pobster

Jahnavi’s picture

thanks for ur reply.

I got what u said but if i give 2 roel to the same user then he will get more permissions.

iam having more cases of permissions then i have to create different different rroles for each,as a base role.

It's not possible right.

If u r sure i can get by ur way can u please be some more briefly the same thing . this will be the last time i promise.

thanks in advance.

Anuja

pobster’s picture

You have to understand that I really don't care if your site works or not, I don't work for Drupal, you haven't paid for Drupal, you certainly aren't paying me to give you advice, I'm only here for the karma - so try your best to read, comprehend and just ... try and use a little imagination.

From what you've written above I gather that you need to create a 'group of roles'? Each will share common set of permissions plus each will have a few extra/ separate permissions as well. This is what Drupal is made for... Here's a little demonstration;

role[co-ordinators]:
permissions;

do stuff
make tea
drink tea
use the telephone

role[team leader]:
permissions;

ask people to make tea
wash up tea cups

role[manager]:
permissions;

ask people to make tea
ask people to wash up

Okay... So as this is an example try to imagine this.

User - Jahavi roles - co-ordinators + team leader
User - Pobster roles - co-ordinators + manager

Each user receives ALL the permissions of their combined roles (hence how comes you don't need to check everything the same as normal users). So in my example YOU can do this;

do stuff
make tea
drink tea
use the telephone
ask people to make tea
wash up tea cups

And as I have a different subset of permissions, I get some of the permissions you do - but the manager role differs slightly from the team leader one, so I get;

do stuff
make tea
drink tea
use the telephone
ask people to make tea
ask people to wash up

Notice that I'm NOT allowed to wash up tea cups, but I can ask people to wash them up. You aren't allowed to ask people to wash up but you are able to wash them yourself. You see, it's not a 'role within a role' you're after, merely multiple roles with combined privileges which is how Drupal works any way.

</lesson>

Pobster

gpk’s picture

Suppose Super coordinator 1 manages group coordinators 1 and 2 who manage contributors 1 2 3 and 4.

Try something like this:

Create role "contributor A", give it the appropriate permissions, and add the 4 contributors to this role.
Create role "group coordinator A", add the *additional* permissions they need, and add the 2 group coordinators to this role and also to role "contributor A".
Finally, create role "super coordinator A", give it the additional permissions needed by the group coordinator and and Super coordinator to this role, and also to the other two A roles.

This may not be exactly what you want, but I suggest you experiment with the different ways of grouping permissions - you should be able to do what you want, but you need to experiment to get a feel for the way it works and therefore find out how you can achieve exactly what you want.

Note that
1. all logged-in users get the permissions of the built-in "authenticated user" role
2. if you belong to 2 or more roles then you get the permissions of all the roles (i.e. permissions are additive)
3. logged-in users don't get the permissions of the built-in "anonymous" role - the permissions you specify for anonymous are *only* used for visitors who are not logged in.

Note also that the built-in permissions at admin/user/access (the "Access control" page) only enable to you allow "read" permission to all nodes or no nodes (see "access content" permission under the node module section). If you want to control "read" (i.e. view) access to individual nodes, either by node type or by some other way (often taxonomy is used for this) then you will need to use a contributed module such as http://drupal.org/project/tac_lite or the slightly more complicated http://drupal.org/project/taxonomy_access. There are more: see here http://drupal.org/node/206666#DRUPAL-5, or http://drupal.org/project/Modules/name. Unfortunately it can be hard to find what you are looking for!

Also if you find you really can't achieve what you want with the standard user role functionality then there are modules that extend the functionality - see http://drupal.org/project/Modules/category/76. Also this one may be useful http://drupal.org/project/accounttypes. Again you will need to experiment a bit to find exactly what you want.

Also http://drupal.org/project/og (Organic Groups) and related modules (http://drupal.org/project/Modules/category/90) can be useful for organising users and content into "groups" - it is used on http://groups.drupal.org. This may be overkill for you, or it may be just what you need - only you can say, after you've tried it out.

Good luck!

gpk
----
www.alexoria.co.uk

Jahnavi’s picture

hi,
thanks for ur reply.

Got a way to do.how it works i have to see.

what ever u said is ok .I have tried that.

guid me in this case......if a article/wiki is posted by a contributor,that must be seen only by the contributors of his group,and the group coordinator of his group.not the other group coordinators or other contributors.

if we give permissions as u said all the contributors of all the groups can ssee the article/wiki.

I tried organic groups,taxonomy but i din't get it.may be i din't go in the right wayi don't know.it's only in the roles subscription not hte role subscription.i tried account type module too but in that what ever we ahve the roles can be assiged as a bulk to a user .

Iam only working on drupal since 15 days so iam unable to find it out.i even don't have knowledge on php to code.

This is my case please check it out...........................................................................................................

--------------------------------------------------------------------------------------------------------------------------

............................................... SC 1..........................................................SC2....
.................................................|.............................................................. |..........
...................................... ---------------- .....................................-------------------- ....
.................................... | ...................... | .................................|.............................|.
................................. GC1 ..................... GC2 ............................GC3........................GC4..
....................................|.......................... | ............................. | ............................. |....
........................... ------------..........------------ ..............----------------........-------------------------.
...........................|................|.........|................|............|......................|........| ............ | ..............|...
........................ C1 ............. C2 ........C3 .......... C4 ......... C5 .................. C6 .....C7 ......... C8 ............ C9....

--------------------------------------------------------------------------------------------------------------------------
if the wiki created by c2 then that must be seen only by C1 and GC1 not by any others .If GC1 publish that wiki then all others can see the wiki.

the same case with GC's.If GC2 created a wiki then only SC1 must see it not any others. when that wiki is published by SC1 then all the others can see the wiki.

so for this i want GC1 in SC1 and GC2 in SC2.

So i am trying for roles in roles is possible or not.

consider this case and help me please.

Thanks in regards.

pobster’s picture

Just use the cck module to create nodes specific to a role. You can then grant permissions based on these node types. As I said before, it just takes a little imagination. Eg.

C2 creates a node of node type "C2s Wiki", this nodetype is permissioned to only be viewable by roles C1 and GC1. (which doesn't make sense in your diagram, but whatever!)
SC1 creates a node of node type "SC1s Wiki" this nodetype is permissioned to be viewable by etc, etc...

You're still thinking about this 'upside-down'... Free your mind a little - "there is no spoon"... 9 times out of 10 there's more than one way to skin a cat, just get this 'role within a role' out of your head, it's nonsense. You're overcomplicating what you need to do...

Pobster

lauscherli’s picture

You can create new roles now and set premissions for these roles, right. Plus you have a automatic user role and a anonymous user role, created by drupal.

Under -> Administer ->User management->Users, you click on the name and then 'Edit account', there you can assign all the roles you want to a user. Only authenticated user and anonymous user you will not see there, because once a user is registered, he is already an authenticated user (but you don't need to give any permissions to authenticated users, if you don't want).

And so you can easily fine-graind your permissions, because PERMISSIONS OF ROLES ARE ADDED.

Lets say you have
Role A
Role B
Role C

You give User 1 Role A -> He will have permissions for Role A (and authenticated and anonymous)
You give User 2 Role A, B and C -> He will have permissions for Role A, B and C (and authenticated and anonymous)
You give User 3 Role C -> He will have permissions for Role C. (and authenticated and anonymous)

So, more I cannot help you.

Good luck!

socialnicheguru’s picture

You might want to investigate the account type module.

http://SocialNicheGuru.com
Delivering inSITE(TM), we empower you to deliver the right product and the right message to the right NICHE at the right time across all product, marketing, and sales channels.