-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improved: facility display logic on Admin/Super user details page(#173) #271
base: main
Are you sure you want to change the base?
Conversation
src/services/UserService.ts
Outdated
const payload = { | ||
inputFields: { | ||
userLoginId, | ||
permissionId: ['STOREFULFILLMENT_ADMIN'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we are passing list in permissionId here?
permissionId: ['STOREFULFILLMENT_ADMIN'] | ||
}, | ||
entityName: "UserLoginSecurityGroupAndPermission", | ||
filterByDate: "Y", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also we will get expired permission in this case. As the UserLoginSecurityGroupAndPermission view has dates for managing UserLogin and Security Group association (fromDate, thruDate) as well as dates for managing SecurityGroup and SecurityGroupPermission associations (SGPFromDate, SGPThruDate). The filterByDate parameter in performFind service by default consider fromDate and thruDate for filtering active records.
We need checks on both the dates which is not possible in performFind. You should use the getPermission api here which is used during login to fetch the user's permission.
src/services/UserService.ts
Outdated
@@ -326,6 +326,34 @@ const getUserSecurityGroup = async (userLoginId: string): Promise<any> => { | |||
|
|||
return userSecurityGroup | |||
} | |||
const isUserFulfillmentAdmin = async (userLoginId: string): Promise<any> => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name of the service suggest that boolean value will be returned, but you are returning data. Either return boolean or change the name of the service.
src/views/UserDetails.vue
Outdated
@@ -520,6 +523,7 @@ export default defineComponent({ | |||
isUserFetched: false, | |||
showPassword: false, | |||
shopifyShopsForProductStore: [] as any, | |||
isUserFulfillmentAdmin: [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isUserFulfillmentAdmin should be boolean.
src/views/UserDetails.vue
Outdated
<ion-item lines="none" v-if="isUserFulfillmentAdmin.length"> | ||
<ion-label>{{ translate("This user has 'STOREFULFILLMENT_ADMIN' permission, enabling access to all facilities.") }}</ion-label> | ||
</ion-item> | ||
<ion-item lines="none" button detail v-else @click="selectFacility()" :disabled="selectedUser.securityGroup.groupId === 'INTEGRATION'"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the Actions.APP_UPDT_FULFILLMENT_FACILITY permission is removed?
… user permissions(hotwax#173)
Related Issues
#173
Short Description and Why It's Useful
Fulfillment
card.STOREFULFILLMENT_ADMIN
permission, it shows the facility selector button.SecurityGroupPermission
to check the user specific permissions w.r.t to group.Screenshots of Visual Changes before/after (If There Are Any)
Contribution and Currently Important Rules Acceptance