Loading...
 
Features / Usability

Features / Usability


Need to set up permissions for access to a web app

posts: 29 United States

I am in the process of finishing a custom built web-app that was designed for use soley with the site that I am working on. (therefore no tikiintegrator). As I am completing it, I am at the point where I need to secure it, as only one group needs to have access to the app. I want to use the same permission framework that is inplace (tiki_p whatever). I am getting pretty familiiar with TW source and DB and was wondering if people have reallytried to integrate thier own stuff in this manner, and if so, where to start, in terms of moding scripts and data tables. Any friendly advice is much appreciated.
Thanks a lot.
-Matt

posts: 2881 United Kingdom

How come you only want friendly advice wink

Well I'm currently integrating my jukebox into CVS HEAD. To create more permissions for the jukebox I've added into the current tiki.sql and tiki_1.8to1.9.sql

then they will appear in the permission list and get made into a $tiki_p_xxxx_xxxxx variable :-) where you can use if ($tiki_p_xxxxx_xxxxx eq y) it.

Damian

posts: 29 United States

> Damian:
> then they will appear in the permission list and get made into a $tiki_p_xxxx_xxxxx variable :-) where you can use if ($tiki_p_xxxxx_xxxxx eq y) it.
>
This is the part that I am a little confused on. I know that the permissions are stored in users_grouppermissions and in users_objectpermissions, but I am wondering how to generate the hash for the objectId in the users_objectpermissions table.

Furthermore, am i correct in saying that the system queries your group everytime you go to a new page and checks to see if you have pernName that matches that object type and or objectId and then decides whether to let you in or not? and so, if that is the case all i need to do is to mod the db and write in tiki_p_xxx_xxx for my new web app? Sorry, i know i sound like an idiot, but I think that i am just a little confused... the source is well done, but it still gets a little tough to read sometime you know? wink

-matt

posts: 2881 United Kingdom

> This is the part that I am a little confused on. I know that the permissions are stored in users_grouppermissions and in users_objectpermissions, but I am wondering how to generate the hash for the objectId in the users_objectpermissions table.
>
> Furthermore, am i correct in saying that the system queries your group everytime you go to a new page and checks to see if you have pernName that matches that object type and or objectId and then decides whether to let you in or not? and so, if that is the case all i need to do is to mod the db and write in tiki_p_xxx_xxx for my new web app? Sorry, i know i sound like an idiot, but I think that i am just a little confused... the source is well done, but it still gets a little tough to read sometime you know? wink
>
> -matt

Hi matt,

dont mess with the tables :-) Tiki does that for you when you in the admingroups. All you need to do is create your perms via the tiki.sql or tiki upgrade sql files into the users_permissions table. just do a insert with the correct values.

Then you can assign your permission via the tiki interface and it go into the group tables etc.

On your source code you want to do something like

Copy to clipboard
if ($tiki_p_matts_permission ne 'y') { $msg ="You cant come here" // call the error.tpl } //run the script


and thats all there is to the tiki perms system.

you only need to insert your perm into the users_permissions table and then tiki will see it and make it available to the adminGroups admin screen.


posts: 29 United States

> Damian:
> then they will appear in the permission list and get made into a $tiki_p_xxxx_xxxxx variable :-) where you can use if ($tiki_p_xxxxx_xxxxx eq y) it.
>
This is the part that I am a little confused on. I know that the permissions are stored in users_grouppermissions and in users_objectpermissions, but I am wondering how to generate the hash for the objectId in the users_objectpermissions table.

Furthermore, am i correct in saying that the system queries your group everytime you go to a new page and checks to see if you have pernName that matches that object type and or objectId and then decides whether to let you in or not? and so, if that is the case all i need to do is to mod the db and write in tiki_p_xxx_xxx for my new web app? Sorry, i know i sound like an idiot, but I think that i am just a little confused... the source is well done, but it still gets a little tough to read sometime you know? wink

-matt

posts: 2881 United Kingdom

> This is the part that I am a little confused on. I know that the permissions are stored in users_grouppermissions and in users_objectpermissions, but I am wondering how to generate the hash for the objectId in the users_objectpermissions table.
>
> Furthermore, am i correct in saying that the system queries your group everytime you go to a new page and checks to see if you have pernName that matches that object type and or objectId and then decides whether to let you in or not? and so, if that is the case all i need to do is to mod the db and write in tiki_p_xxx_xxx for my new web app? Sorry, i know i sound like an idiot, but I think that i am just a little confused... the source is well done, but it still gets a little tough to read sometime you know? wink
>
> -matt

Hi matt,

dont mess with the tables :-) Tiki does that for you when you in the admingroups. All you need to do is create your perms via the tiki.sql or tiki upgrade sql files into the users_permissions table. just do a insert with the correct values.

Then you can assign your permission via the tiki interface and it go into the group tables etc.

On your source code you want to do something like

Copy to clipboard
if ($tiki_p_matts_permission ne 'y') { $msg ="You cant come here" // call the error.tpl } //run the script


and thats all there is to the tiki perms system.

you only need to insert your perm into the users_permissions table and then tiki will see it and make it available to the adminGroups admin screen.


posts: 29 United States
Worked like a charm and a lot eaiser than I thought it was going to be. Thanks a lot Damian. biggrin

Upcoming Events

1)  18 Apr 2024 14:00 GMT-0000
Tiki Roundtable Meeting
2)  16 May 2024 14:00 GMT-0000
Tiki Roundtable Meeting
3)  20 Jun 2024 14:00 GMT-0000
Tiki Roundtable Meeting
4)  18 Jul 2024 14:00 GMT-0000
Tiki Roundtable Meeting
5)  15 Aug 2024 14:00 GMT-0000
Tiki Roundtable Meeting
6)  19 Sep 2024 14:00 GMT-0000
Tiki Roundtable Meeting
7) 
Tiki birthday
8)  17 Oct 2024 14:00 GMT-0000
Tiki Roundtable Meeting
9)  21 Nov 2024 14:00 GMT-0000
Tiki Roundtable Meeting
10)  19 Dec 2024 14:00 GMT-0000
Tiki Roundtable Meeting