In the spirit of DRY: centralized IsAdmin() check in an extension method
Made sure that non-admins can't trigger the enable/disable URL tracker endpoint Renamed "admin" in GetEnableState to "isUserAdmin" for clarity
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
searchTerm: "",
|
||||
loading: false,
|
||||
urlTrackerDisabled: false,
|
||||
admin: false
|
||||
userIsAdmin: false
|
||||
};
|
||||
|
||||
vm.pagination = {
|
||||
@@ -43,7 +43,7 @@
|
||||
vm.dashboard.loading = true;
|
||||
return redirectUrlsResource.getEnableState().then(function (response) {
|
||||
vm.dashboard.urlTrackerDisabled = response.enabled !== true;
|
||||
vm.dashboard.admin = response.admin;
|
||||
vm.dashboard.userIsAdmin = response.userIsAdmin;
|
||||
vm.dashboard.loading = false;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
<umb-editor-sub-header-content-right>
|
||||
|
||||
<umb-editor-sub-header-section ng-if="vm.dashboard.admin === true">
|
||||
<umb-editor-sub-header-section ng-if="vm.dashboard.userIsAdmin === true">
|
||||
|
||||
<button
|
||||
ng-if="vm.dashboard.urlTrackerDisabled === false"
|
||||
|
||||
Reference in New Issue
Block a user