12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- /**
- * Created by robin on 11/4/15.
- */
-
- angular.module('luticate')
- .controller('GroupEditController', ['$scope', 'luticateAuthGroups', 'data', 'dialogs',
- function($scope, luticateAuthGroups, data, dialogs) {
- if (data != null) {
- $scope.group = data;
- $scope.permission = "LU_GROUP_EDIT";
- }
- else {
- $scope.group = {
- Name: ""
- };
- $scope.permission = "LU_GROUP_ADD";
- }
-
- $scope.submitForm = function()
- {
- if ($scope.group.Id != null) {
- return luticateAuthGroups.edit({
- group_id: $scope.group.Id,
- group_name: $scope.group.Name
- });
- }
- else {
- return luticateAuthGroups.add({
- group_name: $scope.group.Name
- });
- }
- };
-
- $scope.editPermissions = function(group)
- {
- dialogs.create('views/modals/grouppermissions.html', 'GroupPermissionsController', group);
- };
-
- $scope.editUsers = function(group)
- {
- dialogs.create('views/modals/groupusers.html', 'GroupUsersController', group);
- };
- }]);
|