Welcome Guest, Not a member yet? Register   Sign In
Permission Library
#1

[eluser]tdktank59[/eluser]
Alright heres my first release of my permission library.

Its a bit finicky but its working. No nice GUI yet but that will come later.

First off some details

Requirements:
DataMapper 1.6.0 (OverZealous's version *it's included with the files)
PHP 5 (OOP)
Some sort of DB of course!
works with ME as far as I know.
Other than that, thats it as far as I can tell.

So Some details now:
This is a permission Library, It restricts access based on Class -> Method relation
based on your permissions (see DB diagram)

So basically you can have a User related to many Roles, Teams(groups), or permissions.
You can rename Teams to Groups or w/e i developed it this way for the project im working on. But its supposed to be Groups for a normal installation. (ill change it in the next release).

Each role, team or user can then be related to many permissions. which are relations of pages (class had name space issues) and methods.

Each Role/Team/User to Permissions has a start/end date if you want to restrict time on them as well. If you don't want a start/end date just leave them null and they wont bother you. (I have yet to implement this feature as far as the coding goes).

There is a method inside permission that will also search your controllers folder and auto create your permissions, pages, and methods.

Each permission can have the no_restrict field flagged as TRUE (bool 1) to give it to the user as a default permission (normaly auth->login type stuff, Parts of the site the public can get to).

Download:
http://421entertainment.com/permission_0.0.1.zip
(I have yet to test on a fresh install so let me know how it goes.)

Well there might be some bugs so let me know if you find them. Ill work on a better write up next time otherwise the code is decently documented.
#2

[eluser]tdktank59[/eluser]
Found a small bug...

near line 324

Code:
$permission=array();
$obj = new User();
$obj->where('id',1)->get();

should be
Code:
$permission=array();
$obj = new User();
$obj->where('id',$user_id)->get();




Theme © iAndrew 2016 - Forum software by © MyBB