forked from Echo3ToEcho7/app-catalog
-
Notifications
You must be signed in to change notification settings - Fork 193
/
TeamBoardUtil.js
29 lines (25 loc) · 982 Bytes
/
TeamBoardUtil.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
(function() {
var Ext = window.Ext4 || window.Ext;
Ext.define('Rally.apps.teamboard.TeamBoardUtil', {
requires: [
'Rally.nav.DetailLink'
],
singleton: true,
linkToAdminPage: function(record, text, subPage){
if(Rally.environment.getContext().getPermissions().isWorkspaceOrSubscriptionAdmin() || this._isProjectAdmin(record)){
return Rally.nav.DetailLink.getLink({
record: record,
showHover: false,
subPage: subPage,
text: text
});
}else{
return text;
}
},
_isProjectAdmin: function(record) {
var permissions = Rally.environment.getContext().getPermissions();
return record.self.prettyTypeName === 'project' ? permissions.isProjectAdmin(record.get('_ref')) : permissions.isProjectAdminInAnyProject();
}
});
})();