Coder Social home page Coder Social logo

Comments (16)

alekseybobkov avatar alekseybobkov commented on August 15, 2024

Do you mean that a menu item is not shown although the user is allowed to see it?

from builder-plugin.

vmdao avatar vmdao commented on August 15, 2024

Yes! User is allowed not see.

from builder-plugin.

alekseybobkov avatar alekseybobkov commented on August 15, 2024

I can't replicate the problem. Please make sure that you use latest version of the Builder and core. Submit steps for replicating the problem. If you can - please create a new plugin and attach it as a ZIP file here.

from builder-plugin.

vmdao avatar vmdao commented on August 15, 2024

Ok, I uploaded google driver
https://drive.google.com/folderview?id=0B3lfds0CCdr7OFZFLWk4aUVxcVk&usp=sharing

from builder-plugin.

vmdao avatar vmdao commented on August 15, 2024

@alekseybobkov, Can you look problem?

from builder-plugin.

alekseybobkov avatar alekseybobkov commented on August 15, 2024

I can't confirm the problem. I can see the menu item under the administrator user account and it's expected. When I sign in as another user, I don't see the menu item because the user doesn't have the corresponding permission.

from builder-plugin.

ametad avatar ametad commented on August 15, 2024

I too have a similar problem; hopefully this adds positively to the conversation. With Builder I first create permissions. Then I have set the permissions for backend menus to my controllers in the plugin.

Example, define the permission:
image

Then use it for menu:
image
(the companyname is deliberately crossed)

When a user now gets the permission to '..test.access_test' the menu is NOT shown! When I remove the permission from the menu or when I make the user a superuser; the menu is shown again.

Do I perhaps forget a step or something?

from builder-plugin.

alekseybobkov avatar alekseybobkov commented on August 15, 2024

I still can't reproduce it. That's how I test:

  • Install a test plugin from #51 (comment) (I had to remove updates to not pollute my database).
  • Go to Settings / Administrators.
  • Assign "Allow" value to Other Brands / Manage Orders permission for a test administrator.
  • Log in as the test administrator.
  • Make sure that I see the Manage Orders menu item.

If I change "Allow" to "Deny" I don't see the menu item.

from builder-plugin.

ametad avatar ametad commented on August 15, 2024

Thank you for your response!

I will try the same test plugin as you did, with the same steps and report back.

What do you mean with: "I had to remove updates to not pollute my database". What updates exactly, or does this not concern anyone else you think?

from builder-plugin.

ametad avatar ametad commented on August 15, 2024

Perhaps you mean this:

Rolled back: Daovm.OrderBrand
Reinstalling plugin...
PHP Fatal error: Cannot declare class Daovm\OrderBrand\Updates\BuilderTableUpdateDaovmOrderbrandOrder4, because the nam
e is already in use in /home/vagrant/Code/ubpweb2/plugins/daovm/orderbrand/updates/builder_table_update_daovm_orderbrand
_order_4.php on line 17

I did a little renaming so that the updates runs just fine.

from builder-plugin.

ametad avatar ametad commented on August 15, 2024

My test fails unfortunately. The results (if you miss something, please just ask):

This will test the permissions of another administrator then the account I am logged in; for "Manager Orders" are allowed and denied, to see if the menu items appear.

The other account settings:
image

Permission "Allow":
image

The account belongs to the "Owners" group, the permission for "Manager Orders" in the group is not selected.

Now to test the appearance of the menu item, I log into the backend with this other administrator account: the menu item is NOT shown:
image

But with...
image

The menu item is shown correctly:
image

from builder-plugin.

ametad avatar ametad commented on August 15, 2024

Could this perhaps be a caching / cookie problem..?

from builder-plugin.

ametad avatar ametad commented on August 15, 2024

Some more testing data: I have tested if the controller/action is available for the logged in non-super-user, by going to that url (backend/daovm/orderbrand/orders):

Permission 'daovm.orderbrand.manager_order' for user:

  • denied: access is denied (as intended!)
  • allowed: access is allowed and the page is shown (as intended!)

The only thing that is not correctly working is showing the menu items, accordingly to the permissions set.

from builder-plugin.

ametad avatar ametad commented on August 15, 2024

Deeper into the code of October we dive...

Dump in \Backend\Classes\NavigationManager registerMenuItems()
of $owner and $definitions:

"Daovm.OrderBrand"

array:1 [▼
  "manager_orders" => array:5 [▼
    "label" => "Manager Orders"
    "url" => "http://localhost/backend/daovm/orderbrand/orders"
    "icon" => "icon-bookmark"
    "permissions" => array:1 [▼
      0 => "http://localhost/backend/daovm.orderbrand.manager_order"
    ]
    "sideMenu" => array:1 [▼
      "orders" => array:4 [▼
        "label" => "Orders"
        "url" => "http://localhost/backend/daovm/orderbrand/orders"
        "icon" => "icon-ticket"
        "permissions" => array:1 [▼
          0 => "http://localhost/backend/daovm.orderbrand.manager_order"
        ]
      ]
    ]
  ]
]
"October.Backend"

array:1 [▼
  "dashboard" => array:5 [▼
    "label" => "backend::lang.dashboard.menu_label"
    "icon" => "icon-dashboard"
    "url" => "http://localhost/backend/backend"
    "permissions" => array:1 [▼
      0 => "backend.access_dashboard"
    ]
    "order" => 1
  ]
]

The "permissions" are way different. Is this maybe a problem?

from builder-plugin.

alekseybobkov avatar alekseybobkov commented on August 15, 2024

@ametad, please make sure that you're running the latest build of October. There was an issue #30, which is already fixed, where URLs were applied to permissions.

from builder-plugin.

ametad avatar ametad commented on August 15, 2024

Thank you for pointing that out. Once updated correctly the problem is gone! Permissions and the showing/hiding of menu's works correctly.

from builder-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.