Coder Social home page Coder Social logo

drey2020 / casl-angular-example Goto Github PK

View Code? Open in Web Editor NEW

This project forked from stalniy/casl-angular-example

1.0 0.0 0.0 174 KB

Example integration of CASL and Angular 2+

Home Page: https://codesandbox.io/s/6y325ml5vk

License: MIT License

TypeScript 89.87% HTML 1.57% JavaScript 8.15% CSS 0.41%

casl-angular-example's Introduction

CASL and Angular integration example

DEPRECATED

The example has been moved to https://github.com/stalniy/casl-examples/tree/master/packages/angular-todo

This example shows how to integrate CASL auhorization (i.e. permissions) in Angular application by using completmentary module @casl/angular. Read Managing user permissions in Angular app for detailed explanation.

Generated with angular cli

Installation

# install dependencies
npm install 

# serve with hot reload at localhost:4200
npm start

Description

This application is a basic Todo application with possibility to specify assignee for a task. By default, all users are able to create and read all tasks but update and delete only assigned to them. Any user may create a task and assign it to other users.

Ability configuration can be found in src/services/ability.js, the function that creates Ability instance is in the same file.

Example

<todo-form 
  (newTodo)="addTodo($event)" 
  *ngIf="'Todo' | can: 'create'"
></todo-form>

casl-angular-example's People

Contributors

stalniy avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.