public boolean getAllowDeleteUser() { return selectedUser != null && getCanEditUsers(false) && !BaseSession.isReadOnlyEntry(selectedUser); }
public boolean getAllowEditUser() { return selectedUser != null && getCanEditUsers(true) && !BaseSession.isReadOnlyEntry(selectedUser); }
public boolean getAllowChangePassword() { return selectedUser != null && getCanEditUsers(true) && !BaseSession.isReadOnlyEntry(selectedUser); }
public boolean getAllowDeleteGroup() { if (getAllAdminGroups().contains(selectedGroup.getId())) { return currentUser.isAdministrator(); } return getCanEditGroups() && !BaseSession.isReadOnlyEntry(selectedGroup); }
public boolean getAllowEditGroup() { // Changing administrator group is only given to administrators (not // powerusers) // NXP-10584 if (getAllAdminGroups().contains(selectedGroup.getId())) { return currentUser.isAdministrator(); } return getCanEditGroups() && !BaseSession.isReadOnlyEntry(selectedGroup); }
map.put(e.getValue(), entry.getProperty(dirInfo.dirSchemaName, e.getKey())); if (BaseSession.isReadOnlyEntry(entry)) { readOnlyEntries.add(id);
@Override public DocumentModel adapt(Directory directory, DocumentModel entry) { if (fieldName == null || pattern == null) { log.warn(getClass().getName() + " is missing configuration parameters"); return entry; } if (BaseSession.isReadOnlyEntry(entry)) { // keep already existing flag return entry; } try { Object fieldValue = entry.getProperty(directory.getSchema(), fieldName); String value = fieldValue != null ? fieldValue.toString() : ""; if (pattern.matcher(value).matches()) { BaseSession.setReadWriteEntry(entry); } else { BaseSession.setReadOnlyEntry(entry); } } catch (PropertyException e) { throw new DirectoryException( String.format( "The field '%s' of entry '%s' could not be adapt and map on directory '%s', check that the field exist in the schema", fieldName, entry.getId(), directory.getName()), e); } return entry; }
map.put(e.getValue(), entry.getProperty(dirInfo.dirSchemaName, e.getKey())); if (BaseSession.isReadOnlyEntry(entry)) { readOnlyEntries.add(id);
protected void addUserToGroup(NuxeoPrincipal principal, NuxeoGroup group) { UserManager userManager = Framework.getService(UserManager.class); if (!BaseSession.isReadOnlyEntry(principal.getModel())) { // we can write to the principal List<String> groups = principal.getGroups(); if (groups == null) { groups = new ArrayList<>(); } String groupName = group.getName(); if (!groups.contains(groupName)) { groups.add(groupName); principal.setGroups(groups); userManager.updateUser(principal.getModel()); } } else { // principal is read-only, update through the group instead List<String> users = group.getMemberUsers(); if (users == null) { users = new ArrayList<>(); } String userName = principal.getName(); if (!users.contains(userName)) { users.add(userName); group.setMemberUsers(users); userManager.updateGroup(group.getModel()); } } }
protected void removeUserFromGroup(NuxeoPrincipal principal, NuxeoGroup group) { UserManager userManager = Framework.getService(UserManager.class); if (!BaseSession.isReadOnlyEntry(principal.getModel())) { // we can write to the principal List<String> groups = principal.getGroups(); if (groups == null) { groups = new ArrayList<>(); } String groupName = group.getName(); if (groups.contains(groupName)) { groups.remove(groupName); principal.setGroups(groups); userManager.updateUser(principal.getModel()); } } else { // principal is read-only, update through the group instead List<String> users = group.getMemberUsers(); if (users == null) { users = new ArrayList<>(); } String userName = principal.getName(); if (users.contains(userName)) { users.remove(userName); group.setMemberUsers(users); userManager.updateGroup(group.getModel()); } } }
continue; if (BaseSession.isReadOnlyEntry(sourceEntry)) {
if (BaseSession.isReadOnlyEntry(dm)) { BaseSession.setReadOnlyEntry(clone);
sourceId, ldapSourceDirectory.getName())); if (!BaseSession.isReadOnlyEntry(sourceEntry)) { SearchResult ldapEntry = sourceSession.getLdapEntry(sourceId);