Skip to content

Commit

Permalink
Merge pull request #460 from iShafayet/access-control-client-457
Browse files Browse the repository at this point in the history
Access control client 457
  • Loading branch information
iLGunners authored Oct 18, 2018
2 parents ee18a30 + c425389 commit 167f108
Show file tree
Hide file tree
Showing 40 changed files with 156 additions and 46 deletions.
4 changes: 3 additions & 1 deletion client/src/page-about.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@
}

_ensureAccess() {
return this.accessControl('authenticated');
return this.accessControl({
authLevel: 'authenticated'
});
}

// region: misc =================================
Expand Down
5 changes: 4 additions & 1 deletion client/src/page-add-employee.html
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@
}

_ensureAccess() {
return this.accessControl('privileged', ['PRIV_MODIFY_USERS']);
return this.accessControl({
authLevel: 'organization-selected',
privilegeList: ['PRIV_MODIFY_USERS']
});
}

// region: createEmployee =================================
Expand Down
4 changes: 3 additions & 1 deletion client/src/page-add-organization.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@
}

_ensureAccess() {
return this.accessControl('authenticated');
return this.accessControl({
authLevel: 'authenticated'
});
}

// region: addOrganization =================================
Expand Down
5 changes: 4 additions & 1 deletion client/src/page-add-products.html
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,10 @@
}

_ensureAccess() {
return this.accessControl('privileged', ['PRIV_ADD_PRODUCTS_TO_ALL_INVENTORIES']);
return this.accessControl({
authLevel: 'organization-selected',
privilegeList: ['PRIV_ADD_PRODUCTS_TO_ALL_INVENTORIES']
});
}

_fetchProductCategoryList(cbfn) {
Expand Down
5 changes: 4 additions & 1 deletion client/src/page-bulk-import-product-categories.html
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,10 @@
}

_ensureAccess() {
return this.accessControl('privileged', ['PRIV_MODIFY_ALL_PRODUCT_CATEGORIES']);
return this.accessControl({
authLevel: 'organization-selected',
privilegeList: ['PRIV_MODIFY_ALL_PRODUCT_CATEGORIES']
});
}

// region: ui ===========================
Expand Down
5 changes: 4 additions & 1 deletion client/src/page-edit-customer.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@
}

_ensureAccess() {
return this.accessControl('privileged', ['PRIV_MODIFY_CUSTOMER']);
return this.accessControl({
authLevel: 'organization-selected',
privilegeList: ['PRIV_MODIFY_CUSTOMER']
});
}

// region: editCustomer =================================
Expand Down
5 changes: 4 additions & 1 deletion client/src/page-edit-employee.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,10 @@
}

_ensureAccess() {
return this.accessControl('privileged', ['PRIV_MODIFY_USERS']);
return this.accessControl({
authLevel: 'organization-selected',
privilegeList: ['PRIV_MODIFY_USERS']
});
}

// region: editEmployee =================================
Expand Down
5 changes: 4 additions & 1 deletion client/src/page-edit-outlet.html
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,10 @@
}

_ensureAccess() {
return this.accessControl('privileged', ['PRIV_MODIFY_ALL_OUTLETS']);
return this.accessControl({
authLevel: 'organization-selected',
privilegeList: ['PRIV_MODIFY_ALL_OUTLETS']
});
}

// region: editOutlet =================================
Expand Down
5 changes: 4 additions & 1 deletion client/src/page-edit-product-category.html
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,10 @@
}

_ensureAccess() {
return this.accessControl('privileged', ['PRIV_MODIFY_ALL_PRODUCT_CATEGORIES']);
return this.accessControl({
authLevel: 'organization-selected',
privilegeList: ['PRIV_MODIFY_ALL_PRODUCT_CATEGORIES']
});
}

// region: editProductCategory =================================
Expand Down
5 changes: 4 additions & 1 deletion client/src/page-edit-product.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@
}

_ensureAccess() {
return this.accessControl('privileged', ['PRIV_MODIFY_ALL_PRODUCT_CATEGORIES']);
return this.accessControl({
authLevel: 'organization-selected',
privilegeList: ['PRIV_MODIFY_ALL_PRODUCT_CATEGORIES']
});
}

// region: editCustomer =================================
Expand Down
6 changes: 4 additions & 2 deletions client/src/page-edit-profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,11 @@
this.removeAutoValidation('#changePasswordForm paper-input');
this.removeAutoValidation('#editProfileForm paper-input');
}

_ensureAccess() {
return this.accessControl('authenticated');
return this.accessControl({
authLevel: 'authenticated'
});
}

_processLoadProfile() {
Expand Down
5 changes: 4 additions & 1 deletion client/src/page-edit-sales-return.html
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@
}

_ensureAccess() {
return this.accessControl('privileged', ['PRIV_MODIFY_SALES_RETURN']);
return this.accessControl({
authLevel: 'organization-selected',
privilegeList: ['PRIV_MODIFY_SALES_RETURN']
});
}

_fetchSales(cbfn) {
Expand Down
5 changes: 4 additions & 1 deletion client/src/page-edit-warehouse.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,10 @@
}

_ensureAccess() {
return this.accessControl('privileged', ['PRIV_MODIFY_ALL_WAREHOUSES']);
return this.accessControl({
authLevel: 'organization-selected',
privilegeList: ['PRIV_MODIFY_ALL_WAREHOUSES']
});
}

// region: editWarehouse =================================
Expand Down
5 changes: 4 additions & 1 deletion client/src/page-hire-employee.html
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,10 @@
}

_ensureAccess() {
return this.accessControl('privileged', ['PRIV_MODIFY_USERS']);
return this.accessControl({
authLevel: 'organization-selected',
privilegeList: ['PRIV_MODIFY_USERS']
});
}

// region: proces =================================
Expand Down
4 changes: 3 additions & 1 deletion client/src/page-home.html
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,9 @@
}

_ensureAccess() {
return this.accessControl('authenticated');
return this.accessControl({
authLevel: 'authenticated'
});
}

_computeWarnings() {
Expand Down
5 changes: 4 additions & 1 deletion client/src/page-manage-customers.html
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,10 @@
}

_ensureAccess() {
return this.accessControl('privileged', ['PRIV_VIEW_CUSTOMER']);
return this.accessControl({
authLevel: 'organization-selected',
privilegeList: ['PRIV_VIEW_CUSTOMER']
});
}

_fetchCustomerList(cbfn) {
Expand Down
7 changes: 5 additions & 2 deletions client/src/page-manage-employees.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,12 @@
super.onNavigateOut();
this.app.popPageTitle();
}

_ensureAccess() {
return this.accessControl('privileged', ['PRIV_VIEW_USERS']);
return this.accessControl({
authLevel: 'organization-selected',
privilegeList: ['PRIV_VIEW_USERS']
});
}

_fetchEmployeeList(cbfn) {
Expand Down
4 changes: 3 additions & 1 deletion client/src/page-manage-organizations.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@
}

_ensureAccess() {
return this.accessControl('authenticated');
return this.accessControl({
authLevel: 'authenticated'
});
}

_fetchOrganizationList(cbfn) {
Expand Down
5 changes: 4 additions & 1 deletion client/src/page-manage-outlets.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,10 @@
}

_ensureAccess() {
return this.accessControl('privileged', ['PRIV_VIEW_ALL_OUTLETS']);
return this.accessControl({
authLevel: 'organization-selected',
privilegeList: ['PRIV_VIEW_ALL_OUTLETS']
});
}

_fetchOutletList(cbfn) {
Expand Down
5 changes: 4 additions & 1 deletion client/src/page-manage-product-categories.html
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,10 @@
}

_ensureAccess() {
return this.accessControl('privileged', ['PRIV_VIEW_ALL_INVENTORIES']);
return this.accessControl({
authLevel: 'organization-selected',
privilegeList: ['PRIV_VIEW_ALL_INVENTORIES']
});
}

_fetchProductCategoryList(cbfn) {
Expand Down
5 changes: 4 additions & 1 deletion client/src/page-manage-sales-return.html
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,10 @@
}

_ensureAccess() {
return this.accessControl('privileged', ['PRIV_VIEW_SALES_RETURN']);
return this.accessControl({
authLevel: 'organization-selected',
privilegeList: ['PRIV_VIEW_SALES_RETURN']
});
}

_fetchSalesReturnList(cbfn) {
Expand Down
5 changes: 4 additions & 1 deletion client/src/page-manage-sales.html
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,10 @@
}

_ensureAccess() {
return this.accessControl('privileged', ['PRIV_VIEW_SALES']);
return this.accessControl({
authLevel: 'organization-selected',
privilegeList: ['PRIV_VIEW_SALES']
});
}

_fetchSalesList(cbfn) {
Expand Down
5 changes: 4 additions & 1 deletion client/src/page-manage-warehouses.html
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@
}

_ensureAccess() {
return this.accessControl('privileged', ['PRIV_VIEW_ALL_WAREHOUSES']);
return this.accessControl({
authLevel: 'organization-selected',
privilegeList: ['PRIV_VIEW_ALL_WAREHOUSES']
});
}

_fetchWarehouseList(cbfn) {
Expand Down
4 changes: 3 additions & 1 deletion client/src/page-payment.html
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@
}

_ensureAccess() {
return this.accessControl('authenticated');
return this.accessControl({
authLevel: 'authenticated'
});
}

_processDashboardSummary(cbfn) {
Expand Down
5 changes: 4 additions & 1 deletion client/src/page-pos-select-products.html
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,10 @@
}

_ensureAccess() {
return this.accessControl('privileged', ['PRIV_VIEW_ALL_INVENTORIES']);
return this.accessControl({
authLevel: 'organization-selected',
privilegeList: ['PRIV_VIEW_ALL_INVENTORIES']
});
}

_fetchInventoryDetails(cbfn) {
Expand Down
5 changes: 4 additions & 1 deletion client/src/page-pos.html
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,10 @@
}

_ensureAccess() {
return this.accessControl('privileged', ['PRIV_ACCESS_POS']);
return this.accessControl({
authLevel: 'organization-selected',
privilegeList: ['PRIV_ACCESS_POS']
});
}

// region: pos =================================
Expand Down
5 changes: 4 additions & 1 deletion client/src/page-print-sales-receipt.html
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,10 @@
}

_ensureAccess() {
return this.accessControl('privileged', ['PRIV_VIEW_SALES']);
return this.accessControl({
authLevel: 'organization-selected',
privilegeList: ['PRIV_VIEW_SALES']
});
}

_printAndGoBack() {
Expand Down
5 changes: 4 additions & 1 deletion client/src/page-report-inventories.html
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,10 @@
}

_ensureAccess() {
return this.accessControl('privileged', ['PRIV_VIEW_ALL_INVENTORIES']);
return this.accessControl({
authLevel: 'organization-selected',
privilegeList: ['PRIV_VIEW_ALL_INVENTORIES']
});
}

_fetchInventoriesData(cbfn) {
Expand Down
5 changes: 4 additions & 1 deletion client/src/page-report-sales.html
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,10 @@
}

_ensureAccess() {
return this.accessControl('privileged', ['PRIV_VIEW_SALES']);
return this.accessControl({
authLevel: 'organization-selected',
privilegeList: ['PRIV_VIEW_SALES']
});
}

_fetchSalesList(cbfn) {
Expand Down
5 changes: 4 additions & 1 deletion client/src/page-report-select-inventories.html
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@
}

_ensureAccess() {
return this.accessControl('privileged', ['PRIV_VIEW_ALL_INVENTORIES']);
return this.accessControl({
authLevel: 'organization-selected',
privilegeList: ['PRIV_VIEW_ALL_INVENTORIES']
});
}

_fetchInventoryList(cbfn) {
Expand Down
4 changes: 3 additions & 1 deletion client/src/page-settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,9 @@
}

_ensureAccess() {
return this.accessControl('authenticated');
return this.accessControl({
authLevel: 'authenticated'
});
}

// region: general settinggs =================================
Expand Down
5 changes: 4 additions & 1 deletion client/src/page-view-customer.html
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,10 @@
}

_ensureAccess() {
return this.accessControl('privileged', ['PRIV_VIEW_CUSTOMER']);
return this.accessControl({
authLevel: 'organization-selected',
privilegeList: ['PRIV_VIEW_CUSTOMER']
});
}

_fetchCustomer(cbfn) {
Expand Down
5 changes: 4 additions & 1 deletion client/src/page-view-employee.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@
}

_ensureAccess() {
return this.accessControl('privileged', ['PRIV_VIEW_USERS']);
return this.accessControl({
authLevel: 'organization-selected',
privilegeList: ['PRIV_VIEW_USERS']
});
}

_fetchEmployee(cbfn) {
Expand Down
Loading

0 comments on commit 167f108

Please sign in to comment.