123456789101112131415161718192021222324252627282930313233 |
- /**
- * Created by robin on 11/4/15.
- */
-
- angular.module('luticate')
- .controller('PermissionEditController', ['$scope', 'luticateAuthPermissions', 'data',
- function($scope, luticateAuthPermissions, data) {
- if (data != null) {
- $scope.permission = data;
- $scope.permission.IsNew = false;
- }
- else {
- $scope.permission = {
- Name: "",
- Value: false,
- IsNew: true
- }
- }
-
- $scope.submitForm = function()
- {
- var perm = {
- permission_name: $scope.permission.Name.toUpperCase(),
- permission_value: $scope.permission.Value
- };
- if (!$scope.permission.IsNew) {
- return luticateAuthPermissions.edit(perm);
- }
- else {
- return luticateAuthPermissions.add(perm);
- }
- }
- }]);
|