phpScheduleIt
May 23, 2013, 03:52:14 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: phpScheduleIt 2.4.2 has been released!
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: Resource super users  (Read 1446 times)
thisisandu
Newbie
*

Karma: 0
Posts: 7


« on: September 17, 2008, 10:03:56 AM »

Dear Nick,

Firstly let me thank you for the awesome pice of open source code.
we have been using it successfully for about a week now. I need to make some modifications to the system

In my system, all reservations require admin approval. I would want to add a resource admin for each resource who can approve reservation specific to that equipment.
Also I want to a resource super user group for each resource wherein the members of that group can book resources without admin approval.


Kindly direct me where I should start from. If somework has already been done in this front please inform.


Thanks a ton Smiley
Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5419


WWW
« Reply #1 on: September 22, 2008, 09:42:23 AM »

Unfortunately, this is a much bigger change than it would seem.  You'll need to attach a resource admin to each resource (by adding a userid column to the resource, I would assume).  Then you'll need to change the approveReservations() function in lib/Admin.class.php to give access to users set as resource admins.  Then the database access part of that function will have to only return reservations that the user has access to approve.

There are probably other changes along the road, specifically with many of the Auth::isAdmin() checks.  You'll somehow need to make it possible for a resource admin to be given access to certain parts of the app that only an admin currently has access to.
Logged
thisisandu
Newbie
*

Karma: 0
Posts: 7


« Reply #2 on: September 23, 2008, 09:37:19 AM »

Thanks a lot for your reply. Your answer answers my question on having resource admins who can approve reservations specific to their resource. I also had a question regarding having resource super users who can book resources without the admin's approval. Currently what my plan is to have a 'is_resource_superuser' field in the 'permission' table so for each memberid and machineid there will be an is_resource_superuser field - can be boolean too. Thatz the easy part.

How to I make sure that the approval of the reservation is bypassed when a resource superuser with 'is_resource_superuser' = 1 makes a reservation. I would be grateful if you can guide me in this aspect. I do not want to have any other features made available to the resource_superuser except from being able to book independently. (Note that in my system the default is that every reservation requires admin approval)

thanks a ton Smiley



Anand
Logged
thisisandu
Newbie
*

Karma: 0
Posts: 7


« Reply #3 on: September 23, 2008, 11:50:58 AM »

Okay I looked some more into the code and got some ideas. Unfortunately I am a rookie in php and I need your help in implementing this

I can use getcurrentID () to get the userId. Compare this with the user permissions table to check whether the user is a resource super user for that resource and give him privileges to book independently. For the last part, is there a way if I can modify the '$pending' argument?? Is there a way I can make a change to the function write_reservation in the schedule.template.php file??

I am hoping that this idea wud work out. Plz help me with the mod.


Thanks a ton Smiley


Anand
« Last Edit: September 23, 2008, 11:52:31 AM by thisisandu » Logged
Nick
Administrator
Hero Member
*****

Karma: 15
Posts: 5419


WWW
« Reply #4 on: September 25, 2008, 09:44:04 AM »

You'll just need to change line 118 of reserve.php to perform your check.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2006-2007, Simple Machines Valid XHTML 1.0! Valid CSS!