I’ve some suggestions for the manager interface and user roles.
With my sites I use to ’hack’ the user interface cause I don’t want some parts to appear if the user is not member of the administrators group.
Particularly, I dont want to show the part of the menu with buttons to create new docs or folders if I’ve set to no "allow root" in systems settings.
Those buttons are meaningless and can cause confusion in the user that try to create new document clicking on them and receive an alert saying that they don’t have permission to create new documents (this is particulary true with editors). Cause if I create editor rule giving permission to fully handle documents, they can really do it just from the tree, with the contestual menu.
I have seen with very pleasure that 0.95 version has only 1 manager layout. This make everything more simple, (cause before I had to hack 4 files if I want all layouts working as I need).
The check that is done to see if the user has permission to see the content menu is
if($modx->hasPermission('new_document') ...show content buttons
This is correct but clicking on buttons another check (I don’t know where it is...) prevent the user to create a new document. I think that this check should be done when saving the page, not before. Maybe it should be better to check which parent document is selected on the tree and alert just if no one is selected (to prevent creating a new document in the root).
Another way should be to change the check to allow users to see or not to see that part of the menu. I’ve used this one by doing this.
I’ve created a new function (I’ve inserted it the the modx object making it part of the api)
function isAdmin(){
$sql = "SELECT mur.id FROM ".$modx->getFullTableName('user_roles')." AS mur LEFT JOIN ".$modx->getFullTableName('user_attributes').
" AS mua ON mur.id = mua.role WHERE mur.name = 'Administrator' AND mua.id = ".$modx->getLoginUserId().";";
if($modx->recordCount($modx->dbQuery($sql)) > 0)
return true;
return false;
}
(I have it with $this instead of $modx)
and changed to check like this
if(($modx->config['udperms_allowroot'] && $modx->hasPermission('new_document')) || $modx->isAdmin()) ... show content buttons
About this matter, in the version 0.95 I think that there is a little bug. I do the same things:
- create and editor role with full editing permission on documents but "allow_root" set to no.
- I always find "new document" and "new weblink" in the menu but due allow_root set to no they are not usable. Se also here I think is better to don’t show them, or make the control on the selected parent document in the tree etc etc... as I said before.
- I find another thing that I DONT have to find, the tools menu with import site and export site buttons available. Usign import site I actually create a document in the root also if I’m just a simple editor and "allow_root" is set to no.
I think that this things should be fixed, before to release the final version.
Bye