}
}
public UIPermissionNode getAllUIPermissions(int tenantId, Registry registry)
throws UserAdminException {
UIPermissionNode nodeRoot;
try {
Collection regRoot;
if (tenantId == 0) {
if (CarbonContext.getCurrentContext().getTenantId() != MultitenantConstants.SUPER_TENANT_ID) {
log.error("Illegal access attempt");
throw new UserStoreException("Illegal access attempt");
}
regRoot = (Collection) registry.get(UserMgtConstants.UI_PERMISSION_ROOT);
String displayName = regRoot.getProperty(UserMgtConstants.DISPLAY_NAME);
nodeRoot = new UIPermissionNode(UserMgtConstants.UI_PERMISSION_ROOT, displayName);
} else {
regRoot = (Collection) registry.get(UserMgtConstants.UI_ADMIN_PERMISSION_ROOT);
String displayName = regRoot.getProperty(UserMgtConstants.DISPLAY_NAME);
nodeRoot = new UIPermissionNode(UserMgtConstants.UI_ADMIN_PERMISSION_ROOT,
displayName);
}
buildUIPermissionNode(regRoot, nodeRoot, registry, null, null, null);
return nodeRoot;
} catch (UserStoreException e) {