Disabling method/function call

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
agsel
Forum Newbie
Posts: 4
Joined: Mon Oct 15, 2007 8:54 am

Disabling method/function call

Post 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
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post 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.
agsel
Forum Newbie
Posts: 4
Joined: Mon Oct 15, 2007 8:54 am

Post 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.
Post Reply