restrict use of editing
restrict use of editing
jim54729
Posts: 7Questions: 3Answers: 0
I just purchased the editor, by mistake, but I think i might have use for it. if i add this ability to a table, how do i restrict who can use it? I did not see this anywhere. This is for a website with 50 users, but only 10 should have edit abilities. website is using Access for the db.
This question has accepted answers - jump to:
This discussion has been closed.
Answers
I do this by hiding the buttons for example. To be sure that no updates are being processed on the server you can also set fields to false based on a condition.
Here is an example of the "buttons" section of a table definition:
In PHP on the server side you can use events like this to make sure that certain fields aren't being updated for sure
There is information about this available in the security section of the Editor manual.
Regards,
Allan
one update. if you use the code below all fields are not editable any longer. Could be the simplest way to make sure nothing is edited by non-editors. Using these events you don't need to do anything about the individual field definitions.
@allan a 'preSubmit' event for PHP would be handy ... maybe something for the next release?!
A presubmit in the PHP code would just be code that is given before the creation of the Editor instance. In the code example above, rather than using events, I would just use:
Allan
@allan you could do it that way but if you have 20 fields you would need to repeat it 20 times or am I missing something?
Could do my events simpler of course:
I meant "preSubmit" in a different sense: Just an event that combines the 3 events above into one in order to avoid repeating the code. "preDatabaseProcessing" or whatever you want to call it.
I'd probably use a global validation function for that:
Allan
That is definitely the coolest solution on the server side. Thanks Allan. If you combine it with hiding the buttons for non-Editors this should work really well and be safe too.