/** * INTERNAL */ public UserSession(UserSession src, User user, Collection<Role> roles, Locale locale) { this(src.id, user, roles, locale, src.system); this.user = src.user; this.substitutedUser = this.user.equals(user) ? null : user; }
@Override public String toString() { return getName(); } }
/** * Puts message value with given locale code. * * @param localeCode the locale code * @param value the value to put */ public void putLocalizedMessage(String localeCode, String value) { putValue(localeCode, MESSAGE_KEY, value); } }
public UserInfo(User user) { this.login = user.getLogin(); this.name = user.getName(); this.timeZone = user.getTimeZone(); this.language = user.getLanguage(); } }
public ConstraintData(Constraint constraint) { this.id = constraint.getId(); this.code = constraint.getCode(); this.join = constraint.getJoinClause(); this.whereClause = constraint.getWhereClause(); this.groovyScript = constraint.getGroovyScript(); this.operationType = constraint.getOperationType(); this.checkType = constraint.getCheckType(); }
private boolean hasDefaultRole(Set selected) { for (Object roleObj : selected) { UserRole role = (UserRole) roleObj; if (Boolean.TRUE.equals(role.getRole().getDefaultRole())) return true; } return false; } }
/** * Constructor. * * @param type permission type * @param entityOp type of operation on entity * @param target permission target object, e.g. a screen id or entity operation name. When throwing the exception * in application code, can be any string suitable to describe the situation in the log. */ public AccessDeniedException(PermissionType type, EntityOp entityOp, String target) { super(type.toString() + ":" + entityOp.toString() + " " + target); this.type = type; this.target = target; this.entityOp = entityOp; }
@Override public String toString() { return "id=" + getId() + ", login=" + login + ", user=" + userName + ", since=" + since + ", last=" + lastUsedTs; } }
public PermissionType getType() { return type == null ? null : PermissionType.fromId(type); }
public void setOperationType(ConstraintOperationType operationType) { this.operationType = operationType != null ? operationType.getId() : null; }
protected boolean isFilterFolder(SearchFolder folder) { return (folder.getFilterComponentId() != null); }
/** * Constructor. * * @param type permission type * @param target permission target object, e.g. a screen id or entity operation name. When throwing the exception * in application code, can be any string suitable to describe the situation in the log. */ public AccessDeniedException(PermissionType type, String target) { super(type.toString() + " " + target); this.type = type; this.target = target; }
@Override protected void updateValues(LocalizedConstraintMessage item, String localeCode, String value) { item.putLocalizedMessage(localeCode, value); } };
@Override protected void updateValues(LocalizedConstraintMessage item, String localeCode, String value) { item.putLocalizedCaption(localeCode, value); } };
public ConstraintCheckType getCheckType() { return ConstraintCheckType.fromId(checkType); }
public void setLastAction(SessionAction lastAction) { this.lastAction = lastAction == null ? null : lastAction.getId(); }
public Type getType() { return Type.fromId(type); }
public void setType(Type type) { this.type = type.getId(); }
/** * Puts caption value with given locale code. * * @param localeCode the locale code * @param value the value to add */ public void putLocalizedCaption(String localeCode, String value) { putValue(localeCode, CAPTION_KEY, value); }