Group Administrators for Roles v1.0.0

Release Notes

Initial release

  • Now we are talking. This looks to be a big step in getting Elgg groups really rolling.

  • Hello it doesn't work,

    I have installed the Roles Framework, then Moderator roles and Administrator for Roles. When I change a user into a Group moderator, and after that when this new Moderator goes online, the site is not available, internal error 500. 


    What is the reason?

    Best regards.


  • how to extend the role in order to give only the grpup admin the possibility to create event, blog, upload file ?


  • In the pluging where is the instruction to show or hide the button create group ?

  • I would like that only group admin can post into a group and may be create only the event.
    Can you just help me in pne of this thing the rest I will do myself.
    Just to understand where to start..


  • @Ivano Detailed documentation is included with the plugin under docs/manual.pdf. Make sure you read that first. If you have any specific question after reading the docs, fire away.

  • Hi Andras,

    I'm reading the documentation and snow the fog is going a little bit.

    Analizing the code I see this:

    'pages' => array(

                        'groups/add/{$self_guid}' => array('rule' => 'deny'),

    I suppose this is the code that hide  the create button. How can I identify all the others components in the page like upload file and so on ?

    Or more difficoult how do I recognise the field that show the list where it says to post into the group / public / ..... in order to decide that if an user is a group member he can only post into the group ?

    Thank you very much




  • @Ivano:

    "I suppose this is the code that hide  the create button."

    Exactly! Cool that you found it.

    "How can I identify all the others components in the page like upload file and so on ?"

    Most probably they will all be called "PLUGIN_NAME/add/{$self_guid}", where plugin name can be "file", "bookmark", "groups", etc. Try this, if it does not work, then I'm afraid you'll have to look at the code of the relevant plugin.

    "Or more difficoult how do I recognise the field that show the list where it says to post into the group / public / ..... in order to decide that if an user is a group member he can only post into the group ?"

    I'm afraid I don't understand what you need here. Pls give me examples like User "A" is member of Group "B", and I'm trying to disable User "A" uploading a file to Group "B".


  • @Ivano LOL my bad, the configuration to hide the create button on group pages is

    'menus' => array(
      'title::add' => array(
      'rule' => 'deny',
      'context' => array('groups')



    So for disabling the file create button, just add "file" to the context filter, like: 'context' => array('groups', 'file')




  • Thanks Andras.
    I'm courious to know what " 'groups/add/{$self_guid}' => array('rule' => 'deny')" do .

    then if you are a member of a group and you are posting a blog you have the possibility to give access to public / private / auth user / group . I would like to configure in order that a user can post only into a group.

    Sorry for my bad english.

  • Hello Andras,
    I've applier your suggestion and is working fine but with one exception.

    If the user have joined a group in the group main page there is a file widget that show "Upload File". So the user can upload file.

    How can I trap this ?

  • Andras where are you ?
    I need your help please give me an hit


  • I'm more precise now that I've discover where the link to create a new file is located.


    $new_link = elgg_view('output/url', array(
        'href' => "file/add/$group->guid",
        'text' => elgg_echo('file:add'),
        'is_trusted' => true,

    How to hide it using the role ?

  • @ivanoman Try this:

    1. copy the file from mod/file/views/default/file/group_module.php to mod/roles_group_admins/views/override/default/file/group_admin.php

    2. From the new file, remove the reference you've found (that adds the "create new file" link)

    3. In the group admin role configuration, under default role section, add this:

                        'file/group_module' => array(
                            'rule' => 'replace',
                            'view_replacement' => array(
                                 'location' => 'mod/roles_group_admins/views/override/',

    With that you essentially override the original group module file view. Hope this helps, I haven't tested it but the approach should work.

  • Dear Andras.
    thanks for your precious suggestion.
    I've tried but is not working. Seems that is not overriding.
    I'm trying to move the code inside the start.php but apparently nothing change.

  • @ivanoman You probably misplaced the new permission rule, it should be under the views section, for DEFAULT_ROLE. I tested this and works as expected. I created a gist for you with the necessary modifications, take a look here.

  • Andras you are magik !!!
    Thank you very very much.
    Is working fine !

    NOw i go on to personalize the other link.
    Have a wonderfull Sunday.

  • Hi @Andras

    I was trying to make a new role.

    I hide the 'add group' button but when I try to hide the 'edit group' it doesn't work. Also when I try to deny access to 2 pages (create blog and create group) only one rule work and the other won't

    Am I missing something? I read the docs and I can't find the answer :(

  • @rjcalifornia Can you please show me your configuration code? Put it up to github, as a gist:


  • @Andras Thanks for the response, sory for the delay hehe


    Ok, here's the gist:

    And another quick question. How can I deny access to the Administration Dashboard?

  • @rjcalifornia You have multiple issues in your configuration file. The "pages" section of your configuration array is duplicated, while the role plugin expects only a single section for each key ("menus", "actions", etc). When defining multiple rules for a section, they should be listed within the section, so

    "pages" => array(






    I didn't see any attempt in your config to hide the "edit group" button, so I don't know what problem you have bumped into. For denying access to the Admin dashboard, have a look at the roles_moderator plugin for hints.

  • @Andras

    Thanks! It is working now! However, I was looking at the docs and also at the group moderators and roles moderators plugins and I tried to deny the 'edit group' action and it didn't work.

    I also tried to deny access to the 'edit group' page with no results. Here's the code:


    What else am I missing? It looks right, however I don't know.

  • Oh btw your suggestions worked!! Thanks!!!!!!

  • Ok so forget about my last question, I solved by using roles for profile manaager

Arck Interactive

You imagine. We create. We develop custom social networks, content management systems and other rich internet applications. We help entrepreneurs and creative agencies breathe life into their visions. Let's start a conversation!


  • Category: Uncategorized
  • License: GNU General Public License (GPL) version 2
  • Updated: 2014-11-17
  • Downloads: 2099
  • Recommendations: 7

Other Projects

View Arck Interactive's plugins