Welcome Guest, Not a member yet? Register   Sign In
Authentication and ACL better concept
#1

[eluser]Glazz[/eluser]
Hello,

I've been converting this http://net.tutsplus.com/tutorials/php/a-...in-system/ to CodeIgniter and implemented authentication too.

I have it working, both auth and acl, but i have one easy question.


I have a page that shows both my roles and my permissions
http://awesomescreenshot.com/0c71pxn17


My roles are orderes by added date, but permissions are getting ordered by its value (1 = allow / 0 = deny ) desc it means i get allowed permissions first and denied ones second, so Deny overides Allowed.


Is this good or bad ? Or may i order the permissions by the roles ?


I think it works good this way, but well i want to have some opinions =)


Sorry for the english Tongue
#2

[eluser]jellysandwich[/eluser]
Why limit yourself? Make it sortable.

http://tablesorter.com/docs/
#3

[eluser]Glazz[/eluser]
[quote author="jellysandwich" date="1331953864"]Why limit yourself? Make it sortable.

http://tablesorter.com/docs/[/quote]

Well i was not talking about html table sorting but nevermind i have done other way what i wanted to know..


I placed a demo of my authorization and acl library
http://fusephase.com/werxe-auth/admin

Demo credentials:
email: demo@demo.com
password: demo

You can't do changes, like create/update/delete.


I don't know if i'm going to release the code for free, but selling this on CodeCanyon.. But it needs more work and a lot more testing Smile but well it is working good for now.


#4

[eluser]Noobigniter[/eluser]
we do not know where to connect either ...
http://fusephase.com/werxe-auth/admin => no access
http://fusephase.com/werxe-auth/(login|r...ounts|...) => 404
#5

[eluser]Glazz[/eluser]
Yeah sure i gave the wrong url lolz http://fusephase.com/werxe-auth/auth
#6

[eluser]Noobigniter[/eluser]
Haaa got to be one of the only one I have not tested.

It's not bad at all, finally the moment we can not do much as you said so difficult to say more.

I expect to see more, that promise
#7

[eluser]Glazz[/eluser]
Yeah i agree with you, but i limited, for now, the access for the user, because if you delete the role Administrators you lock yourself down, and i now that most people will likelly do that lol, i've done already some changes to it, but this feature preventing you from delete these kind of roles/permissions is yet to be implemented, maybe i'll add this today Smile
#8

[eluser]Noobigniter[/eluser]
So what does this give? it beforehand? I do not know what you plan to do with the code, but if you put it on github, let me know, I'm very interrested. I'd like to create a forum, because there are not really have to CodeIgniter, and I will be very helpful.

In advance thank you
#9

[eluser]Glazz[/eluser]
Well this can be used to give permissions to your users, you can assign roles to users and these roles have permissions, and then in your code you do something like:

Code:
if ( ! $this->werxe_auth->hasPermission('access_protected_area') ):
    echo 'The user doesnt have permission...';
endif;

// your code here....

The 'access_protected_area' is a permission, and for each role this can be turned Allowed/Disallowed

If Allowed the message above doesnt show up, if Disallowed the message shows up, you can do whatever you want, like, redirect the user, show a page telling the user that he doesn't have permission to see that page, etc....

Yes i'm thinking on releasing it on github, but i need to read the documentation, again, because i don't know how to work with it lolz

My code is very well commented and organized, you can see the library itself here http://pastebin.com/wg7W6rJS

Yet it needs more work and more testing Smile
#10

[eluser]Noobigniter[/eluser]
First, thank you so much for sharing this, thus avoiding to do so.
I watched the tutorial on the page, and download the sources. I have then modified a bit to see what it gave, but still required changes.
As soon as I finished setting up (when I have time) my new server, I will test this and will refer bugs / suggestions, I also looked after the documentation.

Again thank you very much Smile




Theme © iAndrew 2016 - Forum software by © MyBB