Page 1 of 1

Disabling method/function call

Posted: Fri Oct 19, 2007 6:53 am
by agsel
I have system, where I have different developers. What I need is, that certain people can't call certain functions.

Problem is that for example there is a function/method which deletes a user. Now if I have a developer, who works on UI, I don't want him/her to use such a function/method.

Even id I can disable all the functions/methods, it would help. So basically I have certain classes, what a developer can use (eg Action or something). Now I would be interested in disabling basically all the functions/methods for all other classes. May-be there will be some functions I need him/her to use, but then those can be implemented in the same class or something. But the main problem is disabling all the other functions/methods.

It would be nice to have a wrapper or like a namespace, where a developer can play without harming the other system.

Any ideas? I think having to check caller for each of function/method is not a solution. I'm looking for something where I can make a separate space for a developer without changing all of my 100++ classes.

using php 5

Posted: Fri Oct 19, 2007 6:59 am
by Kieran Huggins
You could give them a local development version of the code / DB to work against, then check their work before you merge their changes with the trunk. Assuming they're hacking on core code.

If they're writing plugins or something like that, then it sounds like a job for an API to me.

Posted: Fri Oct 19, 2007 7:19 am
by agsel
Well yes, currently the plan is that whey can work their own. So, the option where I check their code, is out.

API, yes. I was more interested whether it can be done more easily. System will have like 100 different Actions, which will be written by different people. They can't access (read/write) my core classes. SO, they have their own sandbox. But they still could access my class, which I have defined for core functionality.

If I could undefine a class or undefine a function, it would be enough.

Another possibility is to check the content of the Action file before including it and removing forbidden functions/methods from the code. Which of course is a very bad solution.