Browse Source

docs: change permission directive usage

pull/6275/head
mehmet-erim 6 years ago
parent
commit
4cab63a266
  1. 12
      docs/en/Tutorials/Part-5.md
  2. 2
      docs/en/UI/Angular/Permission-Management.md

12
docs/en/Tutorials/Part-5.md

@ -423,13 +423,13 @@ Open the `/src/app/book/book.component.html` file and replace the create button
````html ````html
<!-- Add the abpPermission directive --> <!-- Add the abpPermission directive -->
<button abpPermission="BookStore.Books.Create" id="create" class="btn btn-primary" type="button" (click)="createBook()"> <button *abpPermission="'BookStore.Books.Create'" id="create" class="btn btn-primary" type="button" (click)="createBook()">
<i class="fa fa-plus mr-1"></i> <i class="fa fa-plus mr-1"></i>
<span>{%{{{ '::NewBook' | abpLocalization }}}%}</span> <span>{%{{{ '::NewBook' | abpLocalization }}}%}</span>
</button> </button>
```` ````
* Just added `abpPermission="BookStore.Books.Create"` that hides the button if the current user has no permission. * Just added `*abpPermission="'BookStore.Books.Create'"` that hides the button if the current user has no permission.
### Hide the Edit and Delete Actions ### Hide the Edit and Delete Actions
@ -443,18 +443,18 @@ Open the `/src/app/book/book.component.html` file and replace the edit and delet
````html ````html
<!-- Add the abpPermission directive --> <!-- Add the abpPermission directive -->
<button abpPermission="BookStore.Books.Edit" ngbDropdownItem (click)="editBook(row.id)"> <button *abpPermission="'BookStore.Books.Edit'" ngbDropdownItem (click)="editBook(row.id)">
{%{{{ '::Edit' | abpLocalization }}}%} {%{{{ '::Edit' | abpLocalization }}}%}
</button> </button>
<!-- Add the abpPermission directive --> <!-- Add the abpPermission directive -->
<button abpPermission="BookStore.Books.Delete" ngbDropdownItem (click)="delete(row.id)"> <button *abpPermission="'BookStore.Books.Delete'" ngbDropdownItem (click)="delete(row.id)">
{%{{{ '::Delete' | abpLocalization }}}%} {%{{{ '::Delete' | abpLocalization }}}%}
</button> </button>
```` ````
* Added `abpPermission="BookStore.Books.Edit"` that hides the edit action if the current user has no editing permission. * Added `*abpPermission="'BookStore.Books.Edit'"` that hides the edit action if the current user has no editing permission.
* Added `abpPermission="BookStore.Books.Delete"` that hides the delete action if the current user has no delete permission. * Added `*abpPermission="'BookStore.Books.Delete'"` that hides the delete action if the current user has no delete permission.
{{else if UI == "Blazor"}} {{else if UI == "Blazor"}}

2
docs/en/UI/Angular/Permission-Management.md

@ -54,8 +54,6 @@ You can use the `PermissionDirective` to manage visibility of a DOM Element acco
As shown above you can remove elements from DOM with `abpPermission` structural directive. As shown above you can remove elements from DOM with `abpPermission` structural directive.
The directive can also be used as an attribute directive but we recommend to you to use it as a structural directive.
## Permission Guard ## Permission Guard
You can use `PermissionGuard` if you want to control authenticated user's permission to access to the route during navigation. You can use `PermissionGuard` if you want to control authenticated user's permission to access to the route during navigation.

Loading…
Cancel
Save