Code Monkey home page Code Monkey logo

authority-laravel's People

Contributors

anaxamaxan avatar kapv89 avatar selrahcd avatar taylorotwell avatar vespakoen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

authority-laravel's Issues

The slash issue

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

doc change

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.

Install instructions are outdated

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.

Timestamps error ?

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 :)

Bug in config/authority.php?

Should line 18 be:

if( count($user->roles) == 0) return false;

instead of

if( ! count($user->roles) == 0) return false;

Example of using Authority in a controller filter?

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();

    }
}

Install Instructions

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!

Documentation: Register before migrate

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.