},
+ /**
+ * @property {Array} appModules - array based on AppModules global
+ */
+ appModules : false,
modules : false,
/**
*
* Pman.register({
modKey : '00-admin-xxxx',
- module : Pman.Tab.projectMgr,
+ module : Pman.Tab.projectMgr, << really a components..
moduleName : 'Pman.Tab.projectMgr',
+ moduleOwner :
region : 'center',
parent : Pman.layout
})
register : function(obj)
{
+
+ // work out owner..
+ if (!this.appModules === false) {
+ this.appModules = typeof(AppModules ) == 'undefined'? [] :
+ AppModules.split(',');
+ }
+
+
+
// ignore registration of objects which are disabled.
// global supplied by master.html
appDisabled = typeof(appDisabled) == 'undefined' ? [] : appDisabled;
if (appDisabled.indexOf(obj.moduleName) > -1) {
return;
}
-
+ // now let's see if the user has the module disabled.
+ // eg. Pman.Tab.AdminProjectManager
+ // matches permission Admin.ProjectManager
+ var np = obj.moduleName.split('.').pop();
+ obj.moduleOwner = '';
+ Roo.each(this.appModules, function(nm) {
+ if (np.substring(0,nm.length) == nm) {
+ obj.moduleOwner = nm;
+ }
+ });
+ if (obj.moduleOwner.length) {
+ var permname = obj.moduleOwner +'.' + np.substring(obj.moduleOwner.length);
+ // we now have permission...
+ // obj.moduleOwner '.' lname
+
+ if (this.hasPermExists(permname) && !this.hasPerm(permname,'S')) {
+ // it's a turned off permission...
+ return;
+ }
+ }
}