It sounds like you need to use hook_perm() here. Though you can always implement your settings per role within your module's settings page as well by pulling in the roles. <br><br>The question is how do you want to define the setting relationships to roles? settings->roles or roles->settings ? <br>
<br>The first you would pull in the roles to your settings page, save the role id with the setting and then provide your own function to check that setting's role designator.<br><br>The second way you just provide a permission to hook_perm() and then you can check with user_access(). <br>
<br>You also need to determine how you need to use these permissions... Is it a general permission, such as 'administer this module' or is it a setting that is per an object. For instance Views and Flag provide access to each individual object (a view or a flag) so that a particular role can access an individual object but also provide a permission in the other sense, such as 'can administer this object'. <br>
<br>Hope that helps.<br><br><div class="gmail_quote">On Sat, Dec 6, 2008 at 6:41 AM, DragonWize <span dir="ltr"><<a href="mailto:dragonwize@gmail.com">dragonwize@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Deji,<br>
<br>
I know hook_perm. My question is what does and does not belong in hook_perm?<br>
<br>
Thank you,<br>
Alan<br>
<div><div></div><div class="Wj3C7c"><br>
<br>
On Fri, Dec 5, 2008 at 18:32, Deji Akala <<a href="mailto:dejiakala@gmail.com">dejiakala@gmail.com</a>> wrote:<br>
> Hi dragonwize,<br>
><br>
> Have you tried hook_perm() ?<br>
><br>
> 2008/12/5 DragonWize <<a href="mailto:dragonwize@gmail.com">dragonwize@gmail.com</a>><br>
>><br>
>> Hi,<br>
>><br>
>> I have a module that I has some display settings and I would like to<br>
>> make these settings per role. The easy way it seems to be to use the<br>
>> core perm system, however, I am not entirely sure that they really<br>
>> belong there.<br>
>><br>
>> Is there and consensus or thoughts on what should be a perm vs a module<br>
>> setting.<br>
>><br>
>> Thanks,<br>
>> Alan<br>
><br>
><br>
><br>
> --<br>
> Deji Akala<br>
> iJed Webs Ltd<br>
> <a href="http://www.ijed.co.uk" target="_blank">http://www.ijed.co.uk</a><br>
> Tel: +44 (0)1793 495537<br>
> Mob: +44 (0)7951 619654<br>
><br>
> "He is no fool who gives what he cannot keep to gain what he cannot lose."<br>
><br>
</div></div></blockquote></div><br>