You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

groupedit.controller.js 1.1KB

123456789101112131415161718192021222324252627282930313233343536
  1. /**
  2. * Created by robin on 11/4/15.
  3. */
  4. angular.module('luticate')
  5. .controller('GroupEditController', ['$scope', 'luticateAuthGroups', 'data', 'dialogs',
  6. function($scope, luticateAuthGroups, data, dialogs) {
  7. if (data != null) {
  8. $scope.group = data;
  9. }
  10. else {
  11. $scope.group = {
  12. Name: ""
  13. }
  14. }
  15. $scope.submitForm = function()
  16. {
  17. if ($scope.group.Id != null) {
  18. return luticateAuthGroups.edit({
  19. group_id: $scope.group.Id,
  20. group_name: $scope.group.Name
  21. });
  22. }
  23. else {
  24. return luticateAuthGroups.add({
  25. group_name: $scope.group.Name
  26. });
  27. }
  28. };
  29. $scope.editPermissions = function(group)
  30. {
  31. dialogs.create('views/modals/grouppermissions.html', 'GroupPermissionsController', group);
  32. };
  33. }]);