add perm check
This commit is contained in:
parent
1ac38f26cb
commit
900127dd45
3 changed files with 52 additions and 4 deletions
|
|
@ -295,7 +295,16 @@
|
|||
>
|
||||
<!-- <div> Commit Message </div> -->
|
||||
<!-- <p class="text-2xl mr-8 text-gray-400 dark:text-gray-500">Commit Message</p> -->
|
||||
<input type="text" name="commit-message" id="commit-message" placeholder="Commit Message" class="input input-bordered mr-8 w-full max-w-xs" [value]="productCode" (keyup)="onKeyUpCommitMsg($event)"/>
|
||||
<input
|
||||
type="text"
|
||||
name="commit-message"
|
||||
id="commit-message"
|
||||
placeholder="Commit Message"
|
||||
class="input input-bordered mr-8 w-full max-w-xs"
|
||||
[value]="productCode"
|
||||
(keyup)="onKeyUpCommitMsg($event)"
|
||||
[disabled]="!isEditable()"
|
||||
/>
|
||||
<button
|
||||
(click)="onPressConfirmClose()"
|
||||
class="btn btn-error w-36 text-white mr-2"
|
||||
|
|
@ -305,7 +314,7 @@
|
|||
<button
|
||||
(click)="onPressConfirmSave()"
|
||||
class="btn btn-success w-36 text-white"
|
||||
[disabled]="!isValueChanged"
|
||||
[disabled]="!isValueChanged || !isEditable()"
|
||||
>
|
||||
Save
|
||||
</button>
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import {
|
|||
} from 'src/app/core/models/recipe.model';
|
||||
import { ActionRecord } from 'src/app/shared/actionRecord/actionRecord';
|
||||
import { UserService } from 'src/app/core/services/user.service';
|
||||
import { UserPermissions } from 'src/app/core/auth/userPermissions';
|
||||
|
||||
@Component({
|
||||
selector: 'app-recipe-details',
|
||||
|
|
@ -201,4 +202,8 @@ export class RecipeDetailsComponent implements OnInit {
|
|||
this.repl = repl as never[];
|
||||
this.isValueChanged ||= repl != undefined;
|
||||
}
|
||||
|
||||
isEditable(){
|
||||
return this._userService.getCurrentUser()!.permissions.includes(UserPermissions.EDITOR);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue