Skip to content

Instantly share code, notes, and snippets.

@desaroxx
Last active April 8, 2016 11:42
Show Gist options
  • Save desaroxx/fd6b63310b1a8beb8710593284743743 to your computer and use it in GitHub Desktop.
Save desaroxx/fd6b63310b1a8beb8710593284743743 to your computer and use it in GitHub Desktop.

Permission Service

Create a permission service in the cockpit.

Add mock logic to the serivce. Real logic will be implemented later.

Possible values for getPermission

objectName examples:

  • SERVICECALL
  • SERVICEASSIGNMENT

possible values for operation:

  • create
  • read
  • update
  • delete

possible values for returnValue:

  • NONE
  • OWNER
  • ALL
// file location: /cs-components/cockpit/permission/PermissionService.ts
export class PermissionService {
public getPermission = (objectName: string, operation: string): string => {
// some mock logic here
return returnValue;
};
}
angular.module(moduleName).service('csPermissionService', PermissionService);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment