vespakoen / authority-laravel Goto Github PK
View Code? Open in Web Editor NEWRole Based Access Control bundle for Laravel
Home Page: http://vespakoen.github.com/authority-laravel/
Role Based Access Control bundle for Laravel
Home Page: http://vespakoen.github.com/authority-laravel/
Is possible in future update, you add groups?
:)
Should line 18 be:
if( count($user->roles) == 0) return false;
instead of
if( ! count($user->roles) == 0) return false;
The install instructions need updating for the latest version of the develop branch. The 'bundle' setting no longer exists in application/config/application.php, it was removed in this commit.
I really enjoyed using this with Codeigniter, so it'll be great to see how it works with Laravel!
The whole section "Configure Auth config" in the read me file is a bit out-of-date, I think. Those methods in config/auth.php
are already there by default, but using the non-Eloquent methods.
just a quick heads up that if you follow the exact steps of the installation procedure the migration fails because the bundle hasn't been registered yet. You have to add authority to your bundles file first before you can run
php artisan migrate authority
Is it possible to use Authority in a filter? That way, I could filter an entire controller (and/or just one method) to restrict access somehow. Something like (semi-pseudo code):
<?php
class Admin_Controller extends Controller {
public function __construct() {
// require csrf on posts
$this->filter('before', 'csrf')->on('post');
// on admins can view this stuff
$this->filter('authority', 'has_role:admin');
parent::__construct();
}
}
Hi,
I don't know if this is normal but it doesn't sound logic from my POV...
created_at automatically update every time I edit my table but not updated_at. Shouldn't be the opposite? According to their names, I'm expecting the reverse behavior.
I used the code in migrations and both are similar so I can imagine this is a Laravel issue?
$table->timestamp('created_at');
$table->timestamp('updated_at');
Sorry to disturb you :)
On Mac you can have problem with / when including files. This can be solved to use \ or DIRECTORY_SEPARATOR constant.
The problem is caused on bundles/authority/start.php
<?php
Laravel\Autoloader::map(array(
'Authority' => __DIR__.'/authority'.EXT,
));
Authority::initialize(Auth::user());
Suggestion: Remove / and use DIRECTORY_SEPARATOR
Not sure if you're updating this anymore - but the bundle API has been down for some time, so the instructions for installation need to be updated, simply by changing the current details to:
git submodule add ... etc. (if it's an existing repository) or
git clone ... etc. to the bundles/authority directory for projects without version control.etc.
or git archive...etc. whatever.
Currently it's impossible to install with the current directions, which could be an issue for users still on L3.
Please update:
http://bundles.laravel.com/bundle/authority
Or redirect to this page:
http://vespakoen.github.com/authority-laravel/
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.