change new ROLE & permission role

master
luoyang 6 years ago
parent 7c0bc3f019
commit 784bd85360

@ -38,6 +38,8 @@ public class ManagerInfo {
private boolean riskmanager;
private boolean guest;
private boolean orgmanager;
private boolean salesmanager;
private boolean datacontent;
@JSONField(name = "org_id")
private Integer orgId;
@ -105,6 +107,12 @@ public class ManagerInfo {
if (orgmanager){
role |= ManagerRole.ORG_MANAGER.getMask();
}
if (salesmanager) {
role |= ManagerRole.SALES_MANAGER.getMask();
}
if (datacontent) {
role |= ManagerRole.DATA_CONTENT.getMask();
}
account.put("role", role);
if (insert) {
account.put("username", getUsername());
@ -273,4 +281,19 @@ public class ManagerInfo {
this.orgmanager = orgmanager;
}
public boolean isDatacontent() {
return datacontent;
}
public boolean isSalesmanager() {
return salesmanager;
}
public void setDatacontent(boolean datacontent) {
this.datacontent = datacontent;
}
public void setSalesmanager(boolean salesmanager) {
this.salesmanager = salesmanager;
}
}

@ -41,9 +41,9 @@ public class QueryManagerBean {
if(role.equals("10000")){
mask = ManagerRole.SERVANT.getMask();
}
if(role.equals("100000")){
mask = ManagerRole.ACCOUNT_MANAGER.getMask();
}
// if(role.equals("100000")){
// mask = ManagerRole.ACCOUNT_MANAGER.getMask();
// }
if(role.equals("1000000")){
mask = ManagerRole.DIRECTOR.getMask();
}
@ -62,9 +62,15 @@ public class QueryManagerBean {
if(role.equals("100000000000")){
mask = ManagerRole.GUEST.getMask();
}
if(role.equals("1000000000000")){
mask = ManagerRole.ORG_MANAGER.getMask();
// if(role.equals("1000000000000")){
// mask = ManagerRole.ORG_MANAGER.getMask();
// }
if(role.equals("10000000000000")){
mask = ManagerRole.SALES_MANAGER.getMask();
}
// if(role.equals("100000000000000")){
// mask = ManagerRole.DATA_CONTENT.getMask();
// }
if(mask != 0){
params.put("mask",mask);
}

@ -52,14 +52,17 @@ public class ManagerAccountServiceImpl implements ManagerAccountsService {
manager.put("bd", ManagerRole.BD_USER.hasRole(role));
manager.put("finacial", ManagerRole.FINANCIAL_STAFF.hasRole(role));
manager.put("servant", ManagerRole.SERVANT.hasRole(role));
manager.put("accountmanager", ManagerRole.ACCOUNT_MANAGER.hasRole(role));
// manager.put("accountmanager", ManagerRole.ACCOUNT_MANAGER.hasRole(role));
manager.put("director", ManagerRole.DIRECTOR.hasRole(role));
manager.put("sitemanager", ManagerRole.SITE_MANAGER.hasRole(role));
manager.put("developer", ManagerRole.DEVELOPER.hasRole(role));
manager.put("bdleader", ManagerRole.BD_LEADER.hasRole(role));
manager.put("riskmanager", ManagerRole.RISK_MANAGER.hasRole(role));
manager.put("guest", ManagerRole.GUEST.hasRole(role));
manager.put("orgmanager", ManagerRole.ORG_MANAGER.hasRole(role));
// manager.put("orgmanager", ManagerRole.ORG_MANAGER.hasRole(role));
manager.put("salesmanager", ManagerRole.SALES_MANAGER.hasRole(role));
// manager.put("datacontent", ManagerRole.DATA_CONTENT.hasRole(role));
}
return managers;
}

@ -228,11 +228,11 @@ margin-bottom: 10%;"/>
ng-class="{'text-orange':!('1000'|withRole),'text-gray':('1000'|withRole)}"></i>
<i class="fa fa-tty" title="Service"
ng-class="{'text-orange':!('10000'|withRole),'text-gray':('10000'|withRole)}"></i>
<i class="fa fa-university" title="Account Manager"
ng-class="{'text-orange':!('100000'|withRole),'text-gray':('100000'|withRole)}"></i>
<!--<i class="fa fa-university" title="Account Manager"-->
<!--ng-class="{'text-orange':!('100000'|withRole),'text-gray':('100000'|withRole)}"></i>-->
<i class="fa fa-line-chart" title="Director"
ng-class="{'text-orange':!('1000000'|withRole),'text-gray':('1000000'|withRole)}"></i>
<i class="fa fa-map-o" title="Site Manager"
<i class="fa fa-map-o" title="Markting"
ng-class="{'text-orange':!('10000000'|withRole),'text-gray':('10000000'|withRole)}"></i>
<i class="fa fa-code" title="Developer"
ng-class="{'text-orange':!('100000000'|withRole),'text-gray':('100000000'|withRole)}"></i>
@ -240,8 +240,13 @@ margin-bottom: 10%;"/>
ng-class="{'text-orange':!('10000000000'|withRole),'text-gray':('10000000000'|withRole)}"></i>
<i class="fa fa-tripadvisor" title="GUEST"
ng-class="{'text-orange':!('100000000000'|withRole),'text-gray':('100000000000'|withRole)}"></i>
<i class="fa fa-user-plus" title="Org Manager"
ng-class="{'text-orange':!('1000000000000'|withRole),'text-gray':('1000000000000'|withRole)}"></i>
<!--<i class="fa fa-user-plus" title="Org Manager"-->
<!--ng-class="{'text-orange':!('1000000000000'|withRole),'text-gray':('1000000000000'|withRole)}"></i>-->
<i class="fa fa-ticket" title="Sales Manager"
ng-class="{'text-orange':!('10000000000000'|withRole),'text-gray':('1000000000000'|withRole)}"></i>
<!--<i class="fa fa-save" title="Data content"-->
<!--ng-class="{'text-orange':!('100000000000000'|withRole),'text-gray':('1000000000000'|withRole)}"></i>-->
</small>
</p>
</li>

@ -12,7 +12,7 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
})
}]);
app.controller('managerListCtrl', ['$scope', '$http', '$filter','$uibModal', 'commonDialog', function ($scope, $http,$filter, $uibModal, commonDialog) {
$scope.params = {role:"111111111111"};
$scope.params = {role:"11111111111111"};
$scope.pagination = {};
$scope.listManagers = function (page) {
var params = angular.copy($scope.params);

@ -29,14 +29,16 @@
<option value="100">BD User</option>
<option value="1000">Accountant</option>
<option value="10000">Service</option>
<option value="100000">Account Manager</option>
<!--<option value="100000">Account Manager</option>-->
<option value="1000000">Director</option>
<option value="10000000">Site Manager</option>
<option value="10000000">Markting</option>
<option value="100000000">Developer</option>
<option value="1000000000">BD Leader</option>
<option value="10000000000">Risk Manager</option>
<option value="100000000000">Guest</option>
<option value="1000000000000">Org Manager</option>
<!--<option value="1000000000000">Org Manager</option>-->
<option value="10000000000000">Sales Manager</option>
<!--<option value="100000000000000">Data Ccontent</option>-->
</select>
</div>
@ -104,14 +106,16 @@
<i class="fa fa-crosshairs" title="BD User" ng-class="{'text-green':manager.bd,'text-gray':!manager.bd}"></i>
<i class="fa fa-balance-scale" title="Accountant" ng-class="{'text-green':manager.finacial,'text-gray':!manager.finacial}"></i>
<i class="fa fa-tty" title="Service" ng-class="{'text-green':manager.sevant,'text-gray':!manager.servant}"></i>
<i class="fa fa-university" title="Account Manager" ng-class="{'text-green':manager.accountmanager,'text-gray':!manager.accountmanager}"></i>
<!--<i class="fa fa-university" title="Account Manager" ng-class="{'text-green':manager.accountmanager,'text-gray':!manager.accountmanager}"></i>-->
<i class="fa fa-line-chart" title="Director" ng-class="{'text-green':manager.director,'text-gray':!manager.director}"></i>
<i class="fa fa-map-o" title="Site Manager" ng-class="{'text-green':manager.sitemanager,'text-gray':!manager.sitemanager}"></i>
<i class="fa fa-map-o" title="Markting" ng-class="{'text-green':manager.sitemanager,'text-gray':!manager.sitemanager}"></i>
<i class="fa fa-code" title="Developer" ng-class="{'text-green':manager.developer,'text-gray':!manager.developer}"></i>
<i class="fa fa-male" title="BD Leader" ng-class="{'text-green':manager.bdleader,'text-gray':!manager.bdleader}"></i>
<i class="fa fa-user" title="Risk Manager" ng-class="{'text-green':manager.riskmanager,'text-gray':!manager.riskmanager}"></i>
<i class="fa fa-tripadvisor" title="GUEST" ng-class="{'text-green':manager.guest,'text-gray':!manager.guest}"></i>
<i class="fa fa-user-plus" title="Org Manager" ng-class="{'text-green':manager.orgmanager,'text-gray':!manager.orgmanager}"></i>
<!--<i class="fa fa-user-plus" title="Org Manager" ng-class="{'text-green':manager.orgmanager,'text-gray':!manager.orgmanager}"></i>-->
<i class="fa fa-ticket" title="Sales Manager" ng-class="{'text-green':manager.salesmanager,'text-gray':!manager.salesmanager}"></i>
<!--<i class="fa fa-save" title="Data Content" ng-class="{'text-green':manager.datacontent,'text-gray':!manager.datacontent}"></i>-->
</td>
<td>
<a role="button" class="text-bold text-primary" ng-click="modifyManager(manager)">Modify</a>

@ -63,14 +63,14 @@
<label ng-if="('00001'|withRole)">
<input type="checkbox" ng-model="manager.servant" name="servant">Service
</label>
<label ng-if="!manager.admin && !manager.operator">
<input type="checkbox" ng-model="manager.accountmanager" name="accountmanager">Account Manager
</label>
<!--<label ng-if="!manager.admin && !manager.operator">-->
<!--<input type="checkbox" ng-model="manager.accountmanager" name="accountmanager">Account Manager-->
<!--</label>-->
<label>
<input type="checkbox" ng-model="manager.director" name="director">Director
</label>
<label ng-if="('00001'|withRole)">
<input type="checkbox" ng-model="manager.sitemanager" name="sitemanager">Site Manager
<input type="checkbox" ng-model="manager.sitemanager" name="sitemanager">Markting
</label>
<label ng-if="('00001'|withRole)">
<input type="checkbox" ng-model="manager.developer" name="developer">Developer
@ -81,9 +81,15 @@
<label ng-if="('00001'|withRole)">
<input type="checkbox" ng-model="manager.riskmanager" name="riskmanager">Risk Manager
</label>
<label ng-if="('00001'|withRole)">
<!-- <label ng-if="('00001'|withRole)">
<input type="checkbox" ng-model="manager.orgmanager" name="orgmanager">Org Manager
</label>-->
<label ng-if="('00001'|withRole)">
<input type="checkbox" ng-model="manager.salesmanager" name="salesmanager">Sales Manager
</label>
<!-- <label ng-if="('00001'|withRole)">
<input type="checkbox" ng-model="manager.datacontent" name="datacontent">Data Content
</label>-->
</p>
</div>
<div class="form-group" ng-if="isOrgModify&&!isModifyOrgManage">

@ -69,14 +69,14 @@
<label ng-if="('00001'|withRole) && !manager.admin && !manager.operator">
<input type="checkbox" ng-model="manager.servant" name="servant">Service
</label>
<label ng-if="!manager.admin && !manager.operator">
<input type="checkbox" ng-model="manager.accountmanager" name="accountmanager">Account Manager
</label>
<!--<label ng-if="!manager.admin && !manager.operator">-->
<!--<input type="checkbox" ng-model="manager.accountmanager" name="accountmanager">Account Manager-->
<!--</label>-->
<label>
<input type="checkbox" ng-model="manager.director" name="director">Director
</label>
<label ng-if="('00001'|withRole)">
<input type="checkbox" ng-model="manager.sitemanager" name="sitemanager">Site Manager
<input type="checkbox" ng-model="manager.sitemanager" name="sitemanager">Markting
</label>
<label ng-if="('00001'|withRole)">
<input type="checkbox" ng-model="manager.developer" name="developer">Developer
@ -90,9 +90,15 @@
<label ng-if="('00001'|withRole)">
<input type="checkbox" ng-model="manager.guest" name="guest">Guest
</label>
<!--<label ng-if="('00001'|withRole)">-->
<!--<input type="checkbox" ng-model="manager.orgmanager" name="guest">Org Manager-->
<!--</label>-->
<label ng-if="('00001'|withRole)">
<input type="checkbox" ng-model="manager.orgmanager" name="guest">Org Manager
<input type="checkbox" ng-model="manager.salesmanager" name="salesmanager">Sales Manager
</label>
<!--<label ng-if="('00001'|withRole)">-->
<!--<input type="checkbox" ng-model="manager.datacontent" name="datacontent">Data Content-->
<!--</label>-->
</p>
</div>
<div class="form-group" ng-if="!currentUser.org_id &&isOrg">

@ -43,17 +43,17 @@
<i class="fa fa-tty"></i>
Service
</a>
<a class="btn btn-app" role="button" ng-click="authorizeRole('100000')">
<i class="fa fa-university"></i>
Account Manager
</a>
<!--<a class="btn btn-app" role="button" ng-click="authorizeRole('100000')">-->
<!--<i class="fa fa-university"></i>-->
<!--Account Manager-->
<!--</a>-->
<a class="btn btn-app" role="button" ng-click="authorizeRole('1000000')">
<i class="fa fa-line-chart"></i>
Director
</a>
<a class="btn btn-app" role="button" ng-click="authorizeRole('10000000')">
<i class="fa fa-map-o"></i>
Site Manager
Markting
</a>
<a class="btn btn-app" role="button" ng-click="authorizeRole('100000000')">
<i class="fa fa-code"></i>
@ -67,10 +67,18 @@
<i class="fa fa-tripadvisor"></i>
GUEST
</a>
<a class="btn btn-app" role="button" ng-click="authorizeRole('1000000000000')">
<i class="fa fa-user-plus"></i>
Org Manager
<!--<a class="btn btn-app" role="button" ng-click="authorizeRole('1000000000000')">-->
<!--<i class="fa fa-user-plus"></i>-->
<!--Org Manager-->
<!--</a>-->
<a class="btn btn-app" role="button" ng-click="authorizeRole('10000000000000')">
<i class="fa fa-ticket"></i>
Sales Manager
</a>
<!--<a class="btn btn-app" role="button" ng-click="authorizeRole('100000000000000')">-->
<!--<i class="fa fa-save"></i>-->
<!--Data Content-->
<!--</a>-->
</div>
</div>
</div>

Loading…
Cancel
Save