Skip to content
This repository has been archived by the owner on Jan 27, 2021. It is now read-only.

Commit

Permalink
admin 拥有全部权限
Browse files Browse the repository at this point in the history
  • Loading branch information
zhou-hao committed Jan 22, 2019
1 parent a270e71 commit 0efe06b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ui/admin/commons/authorize.js
Expand Up @@ -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];
//用户持有的权限
Expand All @@ -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];
Expand Down

0 comments on commit 0efe06b

Please sign in to comment.