Skip to content
This repository has been archived by the owner on Jul 3, 2020. It is now read-only.

[WIP] permissions list function #305

Closed
wants to merge 1 commit into from
Closed

[WIP] permissions list function #305

wants to merge 1 commit into from

Conversation

Orkin
Copy link
Contributor

@Orkin Orkin commented Jul 27, 2015

@bakura10 what do you think about this ?
Need more test etc ... It's just a POC

Some typo are incorrect getPermissions return string[] in phpdoc but in fact it's Permission[]

@danizord
Copy link
Member

What's the use case?

@Orkin
Copy link
Contributor Author

Orkin commented Jul 27, 2015

For retrieve the list of permissions. We can only get role but no permissions. When we use the view helper we don't have to call this method but when you have an API, you need te retrieve permissions on client side and for this an endpoint will be useful.

@danizord
Copy link
Member

@Orkin mhmm, but this is out of the scope of this library. I think it fits your own application service layer, not ZfcRbac.

@Orkin
Copy link
Contributor Author

Orkin commented Jul 27, 2015

I have implemented in my application. It's just sharing in case it had it up here. If this is not the case no problem;).

@danizord
Copy link
Member

@Orkin thanks for your contribution, but I really think it does not fit in this library =/

@bakura10 what do you think?

@bakura10
Copy link
Member

You're right, I'd prefer not to complexicate this even more by introducing a new service. While "RoleInterface" does not have a "getPermissions", the concrete implementation has one (https://github.com/zf-fr/rbac/blob/master/src/Rbac/Role/Role.php#L49).

You could therefore add the method "getPermissions" right into your Identity object, as you can have access to all roles and, in turn, all permissions. I think the logic better suit there and avoid introducing a new service.

Thanks anyway ;).

@bakura10 bakura10 closed this Jul 27, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants