選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

permissionedit.controller.js 1.1KB

1234567891011121314151617181920212223242526272829303132333435
  1. /**
  2. * Created by robin on 11/4/15.
  3. */
  4. angular.module('luticate')
  5. .controller('PermissionEditController', ['$scope', 'luticateAuthPermissions', 'data',
  6. function($scope, luticateAuthPermissions, data) {
  7. if (data != null) {
  8. $scope.permission = data;
  9. $scope.permission.IsNew = false;
  10. $scope.neededPermission = "LU_PERM_EDIT";
  11. }
  12. else {
  13. $scope.permission = {
  14. Name: "",
  15. Value: false,
  16. IsNew: true
  17. };
  18. $scope.neededPermission = "LU_PERM_ADD";
  19. }
  20. $scope.submitForm = function()
  21. {
  22. var perm = {
  23. permission_name: $scope.permission.Name.toUpperCase(),
  24. permission_value: $scope.permission.Value
  25. };
  26. if (!$scope.permission.IsNew) {
  27. return luticateAuthPermissions.edit(perm);
  28. }
  29. else {
  30. return luticateAuthPermissions.add(perm);
  31. }
  32. }
  33. }]);