Skip to content
Permalink
Browse files

admin 拥有全部权限

  • Loading branch information...
zhou-hao committed Jan 22, 2019
1 parent a270e71 commit 0efe06b973317e7d60bcd9922912f8379fec2b88
Showing with 5 additions and 0 deletions.
  1. +5 −0 ui/admin/commons/authorize.js
@@ -34,6 +34,7 @@ define(["request", "jquery"], function (request, $) {
rowMap[this.id] = this;
});
autz.hasPermission = function () {
if(autz.user.username==='admin')return true;
if (arguments.length === 0) return true;
var permission = arguments[0];
//用户持有的权限
@@ -48,12 +49,16 @@ define(["request", "jquery"], function (request, $) {
return false;
};
autz.hasRole = function () {

if(autz.user.username==='admin')return true;
for (var i = 1; i < arguments.length; i++) {
if (rowMap[arguments[i]]) return true;
}
return false;
};
autz.hasFieldAccess = function () {

if(autz.user.username==='admin')return true;
if (arguments.length === 0) return true;
var permission = arguments[0];
var per = permissionMap[permission];

0 comments on commit 0efe06b

Please sign in to comment.
You can’t perform that action at this time.