本文整理汇总了TypeScript中entcore.model.me.hasRight方法的典型用法代码示例。如果您正苦于以下问题:TypeScript model.me.hasRight方法的具体用法?TypeScript model.me.hasRight怎么用?TypeScript model.me.hasRight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类entcore.model.me
的用法示例。
在下文中一共展示了model.me.hasRight方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: function
scope.canAccessSubject = function(subject){
if(model.me.hasRight(subject, Behaviours.applicationsBehaviours.exercizer.rights.resource.manager) || model.me.hasRight(subject, 'owner')){
return true;
} else{
return false;
}
};
示例2: function
angular.forEach(subjectList, function(id){
var subject = SubjectService.getById(id);
if(model.me.hasRight(subject, 'owner')){
//scope.lowerRight = 'owner';
isOneOwner = true
}
else if(model.me.hasRight(subject, Behaviours.applicationsBehaviours.exercizer.rights.resource.manager)){
//scope.lowerRight = 'manager';
isOneManage = true;
}
else if(model.me.hasRight(subject, Behaviours.applicationsBehaviours.exercizer.rights.resource.contrib)){
//scope.lowerRight = 'contrib';
isOneContrib = true;
}
else{
//scope.lowerRight = 'read';
isOneRead = true;
}
});
示例3: isSelectableSubject
function isSelectableSubject(subject){
var parent_id;
var owner;
if(scope.display.tab == 'subjectShared'){
parent_id = true;
} else{
if(scope.currentFolderId){
parent_id = subject.folder_id == scope.currentFolderId
} else{
parent_id = subject.folder_id == null;
}
}
//
if(model.me.hasRight(subject, 'owner') && scope.display.tab == 'mySubject'){
owner = true
} else if(!model.me.hasRight(subject, 'owner') && scope.display.tab == 'subjectShared') {
owner = true
} else{
owner = false;
}
return parent_id && owner;
}