Access Control Plugin



  • Put in a Feature request only to find out that Access Control is already a thing via the Access Control plugin.

    I’ve got it installed and working, but would like to restrict the UI a bit further, but am struggling how to remove the last 2 menu items: The Access Control button itself, and the LDAP plugin.

    0_1507312680876_9f82f18b-454e-4cfd-8c5a-3c4db56ce1ea-image.png

    I don’t see anywhere within the Access Control Rules to restrict that? Any help would be greatly appreciated. I’m sure it’s possible, I’m just not seeing it.



  • Thanks for the information! This is very helpful, however I have found that adding a new rule doesn’t quite work the way I expect.

    I add the rule using the data called out above and when I click “Add Rule”, it takes me back to the home page with the bandwidth and other graphs. However, the URL doesn’t change to ?node=home. It remains ?node=accesscontrol&sub=addrule.

    Rather curious don’t you think? Also, the new rule isn’t really created either.


  • Developer

    @wayne-workman said in Access Control Plugin:

    @fernando-gietz said in Access Control Plugin:

    To create LDAP plugin rule, in the same way only change Rule Value= ldap

    Is there somewhere where all these are listed?

    The rule value is easy to know. We use the url to restrict the access, for example:

    URL: http://fog_server_name/fog/management/index.php?node=ldap

    The node value of the URL is the Rule Value of the rule.



  • @fernando-gietz said in Access Control Plugin:

    To create LDAP plugin rule, in the same way only change Rule Value= ldap

    Is there somewhere where all these are listed?


  • Developer

    @tom-elliott said in Access Control Plugin:

    Most certainly they are able to be removed. I’ll try to post how on Tuesday

    I have seen that you changed the code :)


  • Developer

    As tom said, you can remove them. To do this you can add a new rules, in this case the two menu icons are “Main Menu” icon.

    The plugin adds, by default, some rules. You want to remove LDAP plugin icon and AccessControl plugin icon.

    0_1507546323010_Screenshot-2017-10-9 http fog6 lgp ehu es.png

    To add new rule:

    1. Go to AccessControl plugin and click in “Add new rule”

    0_1507546426507_Screenshot-2017-10-9 http fog6 lgp ehu es(1).png

    1. Now setup the new rule:
    • Rule type: MAIN_MENU

    • Parent: main

    • Node Parent:

    • Rule Value: accesscontrol

    1. Click in “Create Button”

    The new rule is created, now you need to associate it to the role.

    To create LDAP plugin rule, in the same way only change Rule Value= ldap


  • Senior Developer

    Most certainly they are able to be removed. I’ll try to post how on Tuesday


  • Developer

    you will be able to do it within the Access Control Plugin (haven’t looked at it since it’s been rewritten) - if not you can certainly achieve it with a simple hook.

    public function MenuData($arguments) {
        if (!in_array($this->node,(array)self::$pluginsinstalled)) return;
        if (!self::$FOGUser->isValid()) return;
        $this->linksToFilter = array('accesscontrol', 'ldap');
        foreach((array)$this->linksToFilter AS $i => &$link)
        unset($arguments['main'][$link]);
        unset($link);
        }
    


  • @svalding Those two things you’re trying to remove are themselves plugins, so the access control plugin may not have the features to remove those. Best thing is to just ask the creator of the plugin about it. @Fernando-Gietz what are your thoughts on this?


 

426
Online

41.4k
Users

11.8k
Topics

112.0k
Posts