mirror of
https://github.com/ansible/awx.git
synced 2026-05-08 01:47:35 -02:30
hiding notifcation templates on setup menu
for non org admins
This commit is contained in:
@@ -36,7 +36,8 @@
|
|||||||
Create and edit scripts to dynamically load hosts from any source.
|
Create and edit scripts to dynamically load hosts from any source.
|
||||||
</p>
|
</p>
|
||||||
</a>
|
</a>
|
||||||
<a ui-sref="notifications" class="SetupItem">
|
<a ui-sref="notifications" class="SetupItem"
|
||||||
|
ng-if="orgAdmin">
|
||||||
<h4 class="SetupItem-title">Notifications</h4>
|
<h4 class="SetupItem-title">Notifications</h4>
|
||||||
<p class="SetupItem-description">
|
<p class="SetupItem-description">
|
||||||
Create templates for sending notifications with Email, HipChat, Slack, and SMS.
|
Create templates for sending notifications with Email, HipChat, Slack, and SMS.
|
||||||
|
|||||||
@@ -6,5 +6,30 @@ export default {
|
|||||||
ncyBreadcrumb: {
|
ncyBreadcrumb: {
|
||||||
label: "SETTINGS"
|
label: "SETTINGS"
|
||||||
},
|
},
|
||||||
templateUrl: templateUrl('setup-menu/setup-menu')
|
templateUrl: templateUrl('setup-menu/setup-menu'),
|
||||||
|
resolve: {
|
||||||
|
org_admin:
|
||||||
|
['$rootScope', 'ProcessErrors', 'Rest',
|
||||||
|
function($rootScope, ProcessErrors, Rest){
|
||||||
|
$rootScope.loginConfig.promise.then(function () {
|
||||||
|
if($rootScope.current_user.related.admin_of_organizations){
|
||||||
|
$rootScope.orgAdmin = false;
|
||||||
|
if ($rootScope.current_user.is_superuser) {
|
||||||
|
$rootScope.orgAdmin = true;
|
||||||
|
} else {
|
||||||
|
Rest.setUrl(`/api/v1/users/${$rootScope.current_user.id}/admin_of_organizations`);
|
||||||
|
Rest.get()
|
||||||
|
.success(function(data) {
|
||||||
|
$rootScope.orgAdmin = (data.count) ? true : false;
|
||||||
|
}).error(function (data, status) {
|
||||||
|
ProcessErrors($rootScope, data, status, null, { hdr: 'Error!', msg: 'Failed to find if users is admin of org' + status });
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}]
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user