Move auth service to components directory

pull/3796/head
Alex Dik 9 years ago
parent 9d9aa3c837
commit c8d77db1f8
  1. 12
      frontend/app/components/common/services/model-auth.service.js
  2. 10
      frontend/app/components/common/services/model-auth.service.test.js
  3. 1
      frontend/app/services/index.js

@ -1,4 +1,4 @@
//-- copyright
// -- copyright
// OpenProject is a project management system.
// Copyright (C) 2012-2015 the OpenProject Foundation (OPF)
//
@ -24,9 +24,13 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// See doc/COPYRIGHT.rdoc for more details.
//++
// ++
module.exports = function() {
angular
.module('openproject.services')
.factory('AuthorisationService', AuthorisationService);
function AuthorisationService() {
var links = {};
var AuthorisationService = {
@ -45,4 +49,4 @@ module.exports = function() {
};
return AuthorisationService;
};
}

@ -1,4 +1,4 @@
//-- copyright
// -- copyright
// OpenProject is a project management system.
// Copyright (C) 2012-2015 the OpenProject Foundation (OPF)
//
@ -24,15 +24,15 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// See doc/COPYRIGHT.rdoc for more details.
//++
// ++
/*jshint expr: true*/
describe('AuthorisationService', function() {
var AuthorisationService, query, queryData;
var AuthorisationService, query;
beforeEach(module('openproject.services', 'openproject.models'));
beforeEach(angular.mock.module('openproject.services', 'openproject.models'));
beforeEach(inject(function(_AuthorisationService_){
AuthorisationService = _AuthorisationService_;
@ -52,7 +52,5 @@ describe('AuthorisationService', function() {
it('should not allow action', function() {
expect(AuthorisationService.can('query', 'delete')).to.be.false;
});
});
});

@ -34,7 +34,6 @@ angular.module('openproject.services')
'NotificationsService',
require('./activity-service')
])
.service('AuthorisationService', require('./authorisation-service'))
.service('CacheService', [
'HALAPIResource',
'$http',

Loading…
Cancel
Save