Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hi,how to get my all roles or permissions and to make a tree just like the demo page ? #47

Closed
joostshao opened this issue Jun 6, 2014 · 8 comments

Comments

@joostshao
Copy link

hi,how to get my all roles or permissions and to make a tree just like the demo page ?

@abiusx
Copy link
Contributor

abiusx commented Jun 6, 2014

you can get all roles or all permissions (there are functions for it) that give them as an array sorted by depth. But then you need to use a tree-view widget to show them. In the demo page, we have manually created that tree. It is a part of our next phase to have a GUI tool to manage the trees, but for now you have to do it yourself.


Notice: This message is digitally signed, its source and integrity are verifiable.
If you mail client does not support S/MIME verification, it will display a file (smime.p7s), which includes the X.509 certificate and the signature body. Read more at Certified E-Mail with Comodo and Thunderbird in AbiusX.com

On Jun 6, 2014, at 4:10 AM, joostshao notifications@github.com wrote:

hi,how to get my all roles or permissions and to make a tree just like the demo page ?


Reply to this email directly or view it on GitHub.

@battis
Copy link

battis commented Dec 27, 2014

I found that this code snippet and a recursive traversal of the tree work decently well… for a smallish tree.

@abiusx
Copy link
Contributor

abiusx commented Dec 27, 2014

that is very interesting… @JBurns should be able to use it to create our GUI too!

On Dec 27, 2014, at 1:59 AM, Seth Battis notifications@github.com wrote:

I found that this code snippet http://thecodeplayer.com/walkthrough/css3-family-tree and a recursive traversal of the tree https://github.com/cottonwoodgulch/gulchdb/blob/master/reset_rbac.php#L7 work decently well… for a smallish tree.


Reply to this email directly or view it on GitHub #47 (comment).

@Kern046
Copy link

Kern046 commented Dec 28, 2014

In case you want to use heavy artillery.... :)

http://bl.ocks.org/robschmuecker/raw/7880033/

@tchalvak
Copy link

The tutorial here:
http://phprbac.net/docs_contents.php

Leaves out some really important functionality like this, e.g.

How do I get all the roles of a user?
How do I get all the permissions of a user?

The first question is available in the api docs, so it would be good to link from the tutorial to there to show that there are more methods than just those mentioned in the tutorial.

@abiusx
Copy link
Contributor

abiusx commented Oct 13, 2016

It is specifically not mentioned in the tutorial.
Roles of a user should not be used in decision making within the application. Unless RBAC management is the goal, accessing roles of a user should not ever happen in the application,
the app should just check whether a permission is available for a user or not, and roles are there to mask the complicated assignments.

On Oct 13, 2016, at 5:42 PM, Roy R. notifications@github.com wrote:

The tutorial here:
http://phprbac.net/docs_contents.php http://phprbac.net/docs_contents.php
Leaves out some really important functionality like this, e.g.

How do I get all the roles of a user?
How do I get all the permissions of a user?

The first question is available in the api docs, so it would be good to link from the tutorial to there to show that there are more methods than just those mentioned in the tutorial.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub #47 (comment), or mute the thread https://github.com/notifications/unsubscribe-auth/ABVjWytvlxUnekaRLvnHgLuVwpkpL4Crks5qzqXSgaJpZM4CBvTk.

@tchalvak
Copy link

tchalvak commented Oct 14, 2016

While it's true that roles should play no part in business logic, when viewing a user's account, knowing which roles they have, and listing which permissions they have in total, is quite necessary. Even at a basic level, I need to know which roles bob has... ...because I want to make him a manager & customer_service and floor_manager! But I don't need to do anything if he already has all those roles assigned!

Conversely, if Jane just got demoted, I want to audit her security & permissions, and remove as appropriate.

What is the solution there?

@abiusx
Copy link
Contributor

abiusx commented Oct 14, 2016

I see what you mean. As I said, it is available in the RBAC management part.
I'm not sure if we have one as part of the official package, but there have been a few implemented by people using the lib, and one back in the old days by myself.

Listing all permissions of a user might not be feasible. a root user has all the permissions. listing their high-level permissions or just listing their roles should make more sense.
-A

On Oct 13, 2016, at 9:11 PM, Roy R. notifications@github.com wrote:

While it's true that roles should play no part in business logic, when viewing a user's account, knowing which roles they have, and listing which permissions they have in total, is quite necessary. Even at a basic level, I need to know whether bob has role manager... ...because I want to make him a manager! I don't need to do anything if he already has the manager role.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub #47 (comment), or mute the thread https://github.com/notifications/unsubscribe-auth/ABVjWwnvuPlWWk-Lok-8DWPdcXtAkKZmks5qztbAgaJpZM4CBvTk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants