adding user roles

kernel-4.6.x
Amalka Subasinghe 4 years ago
parent f9a9cff0b9
commit 52c0e55b07

@ -49,7 +49,7 @@ public class TenantCreateObserver extends AbstractAxis2ConfigurationContextObser
DeviceManagementDataHolder.getInstance().getRealmService().getTenantUserRealm(tenantId) DeviceManagementDataHolder.getInstance().getRealmService().getTenantUserRealm(tenantId)
.getUserStoreManager(); .getUserStoreManager();
String tenantAdminName = userRealm.getRealmConfiguration().getAdminUserName(); String tenantAdminName = userRealm.getRealmConfiguration().getAdminUserName();
userStoreManager.addRole(User.DEFAULT_DEVICE_USER, null, User.PERMISSIONS_FOR_DEVICE_USER); userStoreManager.addRole(User.DEFAULT_DEVICE_USER, new String[]{tenantAdminName}, User.PERMISSIONS_FOR_DEVICE_USER);
userStoreManager.addRole(User.DEFAULT_DEVICE_ADMIN, new String[]{tenantAdminName}, userStoreManager.addRole(User.DEFAULT_DEVICE_ADMIN, new String[]{tenantAdminName},
User.PERMISSIONS_FOR_DEVICE_ADMIN); User.PERMISSIONS_FOR_DEVICE_ADMIN);
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {

@ -46,7 +46,8 @@ public class UserRoleCreateObserver implements ServerStartupObserver {
new String[]{tenantAdminName}, new String[]{tenantAdminName},
DeviceManagementConstants.User.PERMISSIONS_FOR_DEVICE_ADMIN); DeviceManagementConstants.User.PERMISSIONS_FOR_DEVICE_ADMIN);
userStoreManager.addRole( userStoreManager.addRole(
DeviceManagementConstants.User.DEFAULT_DEVICE_USER, null, DeviceManagementConstants.User.DEFAULT_DEVICE_USER,
new String[]{tenantAdminName},
DeviceManagementConstants.User.PERMISSIONS_FOR_DEVICE_USER); DeviceManagementConstants.User.PERMISSIONS_FOR_DEVICE_USER);
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {

Loading…
Cancel
Save