mirror of
https://github.com/ansible/awx.git
synced 2026-03-18 01:17:35 -02:30
Show notification menu to users with notification_admin team role
This commit is contained in:
@@ -61,8 +61,8 @@ function AtLayoutController ($scope, $http, strings, ProcessErrors, $transitions
|
|||||||
}
|
}
|
||||||
|
|
||||||
function checkNotificationAdmin () {
|
function checkNotificationAdmin () {
|
||||||
const usersPath = `/api/v2/users/${vm.currentUserId}/roles/?role_field=notification_admin_role`;
|
const notifAdminOrgsPath = 'api/v2/organizations/?role_level=notification_admin_role';
|
||||||
$http.get(usersPath)
|
$http.get(notifAdminOrgsPath)
|
||||||
.then(({ data }) => {
|
.then(({ data }) => {
|
||||||
if (data.count > 0) {
|
if (data.count > 0) {
|
||||||
vm.isNotificationAdmin = true;
|
vm.isNotificationAdmin = true;
|
||||||
@@ -73,7 +73,7 @@ function AtLayoutController ($scope, $http, strings, ProcessErrors, $transitions
|
|||||||
.catch(({ data, status }) => {
|
.catch(({ data, status }) => {
|
||||||
ProcessErrors(null, data, status, null, {
|
ProcessErrors(null, data, status, null, {
|
||||||
hdr: strings.get('error.HEADER'),
|
hdr: strings.get('error.HEADER'),
|
||||||
msg: strings.get('error.CALL', { path: usersPath, action: 'GET', status })
|
msg: strings.get('error.CALL', { path: notifAdminOrgsPath, action: 'GET', status })
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user