antville/code/LayoutImageMgr/securityFunctions.js
2003-11-23 17:46:34 +00:00

16 lines
473 B
JavaScript

/**
* check if user is allowed to add images
* (overwrites imagemgr.checkAdd())
* @see imagemgr/securityFunctions.js
* @param Obj Userobject
* @param Int Permission-Level
* @return String Reason for denial (or null if allowed)
*/
function checkAdd(usr, level) {
if (this._parent.site) {
if ((level & MAY_EDIT_LAYOUTS) == 0)
throw new DenyException("layoutEdit");
} else if (!usr.sysadmin)
throw new DenyException("imageAdd");
return;
}