f3-access | Route access control for the PHP Fat-Free Framework | Authorization library
kandi X-RAY | f3-access Summary
kandi X-RAY | f3-access Summary
Route access control for the PHP Fat-Free Framework
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Check if the user has the given route .
- Parse route string
- Authorize method
- Add a rule to the current route .
- Set or get policy
- Adds a route to the allow rule .
- Creates a new deny route
f3-access Key Features
f3-access Examples and Code Snippets
[ACCESS]
policy = deny ;deny all routes by default
[ACCESS.rules]
ALLOW /foo = *
ALLOW /bar* = Albert,Jean-Louis
DENY /bar/baz = Jean-Louis
[ACCESS.rules]
allow GET|POST /foo = Jim
allow * /bar = Albert,Jim
deny PUT /bar = Jim
$access->deny('/admin*','mike');
$access->deny('/admin/blog/foo','mike');
$access->allow('/admin/blog','mike');
$access->allow('/admin/blog/foo/bar','mike');
$access->deny('/admin/blog/*/bar','mike');
$access->allow('/admin/blog/fo
$access=Access::instance();
$access->policy('allow'); // allow access to all routes by default
$access->deny('/secured.htm'); // globally deny access to /secured.htm
$access->allow('/secured.htm','admin'); // allow "admin" to access /secure
Community Discussions
Trending Discussions on f3-access
QUESTION
I've been using Fat Free Framework 3.6 for a while and I'm having some trouble making sure of a few things related to the variables used; also please note that I'm not that knowledgeable as a PHP programmer. Here are some examples (I'm using a few "shortcut" methods for the SQL mapper, but I guess it's still readable):
...ANSWER
Answered 2017-Jul-23 at 21:55Question #1: can a logged in user change its group?
No, a user cannot directly modify the contents of SESSION
(unless you've provided him a way to do so). The only thing that can be exploited is the access itself, if the session id gets stolen (aka "session hijacking" cf. here or there).
Now, for the sake of flexibility, you'd better save the bare minimum inside SESSION
. Storing the user group in the session prevents your from being able to dynamically change the group of a logged in user (the change will take effect on the next login). I'd rather advise to only store the user id and retrieve the group from it.
Question #2: Does changing the UPLOADS variable makes it different for the entire hive (i.e. all users), or is the change only for the current user?
Only for the current user.
NB: the entire hive is "only for the current user". Only cached variables are shared.
Question #3: How to retrieve a specific group from $arrayOfUserGroups
?
$arrayOfUserGroups
is computed from $userGroups->all()
which I guess is the result of the DB\SQL\Mapper->find()
method. That method doesn't index the results by id, only by order of appearance in the SQL output.
So one way to fix your issue would be to reindex the result before returning it. Something like:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install f3-access
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page