Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added basic controller, service, model, view and spec files for admin…
… role crud for users, fixed implementation for role permission relation to allow proper nesting of permissions, added test
- Loading branch information
Showing
15 changed files
with
568 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
namespace app.admin.users.editUser.roles { | ||
|
||
describe('User Role admin', () => { | ||
|
||
let RolesController:RolesController, | ||
$scope:ng.IScope, | ||
$rootScope:ng.IRootScopeService, | ||
$q:ng.IQService, | ||
fullUserInfo:common.models.User = common.models.UserMock.entity({}); | ||
|
||
beforeEach(() => { | ||
|
||
module('app'); | ||
|
||
inject(($controller, _$rootScope_, _$q_, _notificationService_, _$location_, _regionService_) => { | ||
$rootScope = _$rootScope_; | ||
$scope = $rootScope.$new(); | ||
$q = _$q_; | ||
|
||
RolesController = $controller(app.admin.users.editUser.roles.namespace + '.controller', { | ||
$scope: $scope, | ||
fullUserInfo: fullUserInfo, | ||
regions: _regionService_.supportedRegions, | ||
}); | ||
}); | ||
|
||
}); | ||
|
||
describe('User Roles admin', () => { | ||
|
||
|
||
it('should do something', () => { | ||
|
||
}); | ||
|
||
}); | ||
|
||
}); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<md-card flex novalidate ng-form="RolesController.rolesForm" class="md-whiteframe-z2" layout-padding> | ||
|
||
<md-toolbar> | ||
<div class="md-toolbar-tools"> | ||
<h2>Roles</h2> | ||
</div> | ||
</md-toolbar> | ||
|
||
<pre highlight="">{{RolesController.roles|json}}</pre> | ||
|
||
|
||
</md-card> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
namespace app.admin.users.editUser.roles { | ||
|
||
export const namespace = 'app.admin.users.editUser.roles'; | ||
|
||
export class RolesController { | ||
|
||
public rolesForm:ng.IFormController; | ||
|
||
static $inject = [ | ||
'fullUserInfo', | ||
'roles', | ||
]; | ||
|
||
constructor( | ||
public user:common.models.User, | ||
public roles:any[] | ||
) { | ||
} | ||
} | ||
|
||
angular.module(namespace, []) | ||
.controller(namespace+'.controller', RolesController); | ||
} | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
app/src/app/admin/utilities/systemInformation/systemInformation.tpl.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,4 @@ namespace common.models { | |
|
||
} | ||
|
||
} | ||
|
||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
namespace common.models { | ||
|
||
export class Role extends AbstractModel{ | ||
|
||
protected __primaryKey = 'key'; | ||
|
||
public key:string; | ||
public description:string; | ||
public isDefault:boolean; | ||
public type:string; | ||
|
||
constructor(data:any, exists:boolean = false) { | ||
super(data, exists); | ||
this.hydrate(data, exists); | ||
} | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.