removing CheckAccess module, stale code

This commit is contained in:
Jared Tabor 2017-06-08 09:20:51 -07:00
parent ff62e6b786
commit bcd1307b2e
2 changed files with 0 additions and 63 deletions

View File

@ -1,61 +0,0 @@
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* All Rights Reserved
*************************************************/
/**
* @ngdoc function
* @name helpers.function:Access
* @description routines checking user access
*/
export default
['$rootScope', 'Alert', 'Rest', 'ProcessErrors', '$cookies',
function ($rootScope, Alert, Rest, ProcessErrors, $cookies) {
return function (params) {
// set PermissionAddAllowed to true or false based on user access. admins and org admins are granted
// accesss.
var scope = params.scope,
callback = params.callback || undefined,
me;
// uer may have refreshed the browser, in which case retrieve current user info from session cookie
me = ($rootScope.current_user) ? $rootScope.current_user : $cookies.getObject('current_user');
if (me.is_superuser) {
scope.PermissionAddAllowed = true;
if(callback){
scope.$emit(callback);
}
} else {
if (me.related.admin_of_organizations) {
Rest.setUrl(me.related.admin_of_organizations);
Rest.get()
.success(function (data) {
if (data.results.length > 0) {
scope.PermissionAddAllowed = true;
} else {
scope.PermissionAddAllowed = false;
}
if(callback){
scope.$emit(callback);
}
})
.error(function (data, status) {
ProcessErrors(scope, data, status, null, {
hdr: 'Error!',
msg: 'Call to ' + me.related.admin_of_organizations +
' failed. DELETE returned status: ' + status
});
});
}
}
//if (!access) {
// Alert('Access Denied', 'You do not have access to this function. Please contact your system administrator.');
//}
//return access;
};
}];

View File

@ -5,7 +5,6 @@
*************************************************/
import authenticationService from './authentication.service';
import checkAccess from './checkAccess.factory';
import isAdmin from './isAdmin.factory';
import timer from './timer.factory';
import pendoService from './pendo.service';
@ -13,7 +12,6 @@ import pendoService from './pendo.service';
export default
angular.module('authentication', [])
.factory('Authorization', authenticationService)
.factory('CheckAccess', checkAccess)
.factory('IsAdmin', isAdmin)
.factory('Timer', timer)
.service('pendoService', pendoService);