Skip to content

#3 Show certain fields based on permissions#31

Open
abuelgheit wants to merge 5 commits into
CloudInn:masterfrom
abuelgheit:permissions
Open

#3 Show certain fields based on permissions#31
abuelgheit wants to merge 5 commits into
CloudInn:masterfrom
abuelgheit:permissions

Conversation

@abuelgheit

Copy link
Copy Markdown
Contributor

No description provided.

@thelinuxer
thelinuxer requested a review from ishehata February 17, 2019 16:35

@ishehata ishehata left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the permissions should be part of the FieldConfig attributes or Metadata, so that no naming collisions would happen.
The permissions service check method would take metadata or FieldConfig and check user permissions against it.

@abuelgheit

abuelgheit commented Feb 18, 2019

Copy link
Copy Markdown
Contributor Author

@ishehata
Hey Islam,
About the permissions in metadata I did that already

@abuelgheit

Copy link
Copy Markdown
Contributor Author

@ishehata
I'm done now
Please check

@ishehata ishehata left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am thinking about the permissions attributes, write now they are create, read ... etc,
what if they were dynamic, and the developer would be able to add they keys that suitable for his use case, need to think about it though, and how to do implement it. @thelinuxer what do you think?

<h4> {{ config.label }}</h4>
<span class="spacer"></span>
<button mat-icon-button (click)="addForm()">
<button mat-icon-button (click)="addForm()" *ngIf="permissionsService.checkPermission(config?.permissions, permissionTypeEnum.update)">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you convert the permissionsService to private in the container, and create a function in the component called checkPermissions that makes use of permissionsService ? it would be cleaner this way, and I was thinking maybe the permissions service in the future would return observables instead.

@@ -1,8 +1,10 @@
import { PermissionType } from './../../models/permissions';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please move this to line 8, just to maintain order of imports, and keep them grouped ?

@ishehata ishehata added this to the V1.0.0 milestone Feb 18, 2019
@ishehata ishehata added the Feature Adding a completely new feature label Feb 18, 2019
@thelinuxer

Copy link
Copy Markdown
Member

I am thinking about the permissions attributes, write now they are create, read ... etc,
what if they were dynamic, and the developer would be able to add they keys that suitable for his use case, need to think about it though, and how to do implement it. @thelinuxer what do you think?

I think we should accept the current behaviour and have a change request for the permission modifications. That's of course if you think the default behaviour is usable enough.

@thelinuxer thelinuxer closed this Feb 18, 2019
@thelinuxer thelinuxer reopened this Feb 18, 2019
@thelinuxer

Copy link
Copy Markdown
Member

@ishehata are we done with this pull request ? Can it be merged ?

@ishehata

Copy link
Copy Markdown
Contributor

Still waiting for minor changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature Adding a completely new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants