Comments (4)
it is a means of retriving the current (logged in) user ID to check for permissions, cuz its the most common case.
it is left there to be implemented by the developer, but marking it out in a PSR implementatin woul dbe a good idea. Its authentication domain and should not be included in authorization.
-A
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 Mordad 31, 1392, at 1:48 AM, Jesse Burns [email protected] wrote:
The 'jf::CurrentUser()' method does not exist, causing errors:
$rbac->Users->HasRole()
$rbac->Users->Assign()
$rbac->Users->Unassign()
$rbac->Users->AllRoles()
$rbac->Users->RoleCount()
$rbac->Users->Enforce()
All of the above throw PHP errors if no '$User/$UserID' parameter is provided ($User/$UserID = null). The proper behavior is to check 'jf::CurrentUser()' for current user id, but if 'jf::CurrentUser()' does not exist we get an error stating that fact.I'm assuming that 'CurrentUser' is an interface that users of PhpRbac needs to implement, but wanted to verify that.
I was wondering if it might be a good idea to implement CurrentUser() with a default of 0 (zero, for guest), and either allow the user of PhpRbac to override it, or have a setter so users can dynamically update the current UserID.
I've added the following code to the jf class (jb.php) as a temporary fix so I can continue working on Unit Tests:
static function CurrentUser() {
return 0;
}
—
Reply to this email directly or view it on GitHub.
from rbac.
Thank you. If it's ok with you I will remove any reference to jf::Current user, thus making the user-id mandatory.
I will also update the above mentioned methods and create/throw an exception if the user-id argument is empty.
Sound good?
from rbac.
gr8
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 Shahrivar 1, 1392, at 7:20 AM, Jesse Burns [email protected] wrote:
Thank you. If it's ok with you I will remove any reference to jf::Current user, thus making the user-id mandatory.
I will also update the above mentioned methods and create/throw an exception if the user-id argument is empty.
Sound good?
—
Reply to this email directly or view it on GitHub.
from rbac.
I've addressed this Issue in commit aebafee
Please review and close Issue if everything looks good to you.
from rbac.
Related Issues (20)
- The result of Rbac->Users->hasRole() is incorrect. HOT 1
- How Can I generate Graph Hierarchy? HOT 1
- How to add Rule (such as Author Rule) to an permission HOT 8
- How to move a {Entity} to other parent? HOT 4
- a role can have multiple children but only one direct parent HOT 2
- roles->remove() recursive not clean the relationship with Permission and User with its descendants
- Roles->permissions() & Permissions->roles() only return its directly related permissions and roles HOT 2
- Children() method run slowly HOT 15
- check the existence of a path HOT 6
- PhpRbac.net is down HOT 1
- Retrieve list of roles and permissions stored HOT 2
- Support PHP-Casbin as the authorization backend to provide ACL, RBAC, ABAC at the same time HOT 2
- php_rbac library HOT 1
- How does it work? HOT 13
- SQL server HOT 3
- PhpRbac.net is down. HOT 1
- Library Viability HOT 1
- Edit Roles and Permissions Depth? HOT 1
- Can't find table or something like that? HOT 3
- Roles->children is giving blank array HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rbac.