| | |
| | | }
|
| | |
|
| | | /**
|
| | | * Does the user service support changes to user display name?
|
| | | * |
| | | * @return true or false
|
| | | * @since 1.0.0
|
| | | */
|
| | | @Override
|
| | | public boolean supportsDisplayNameChanges() {
|
| | | return false;
|
| | | }
|
| | |
|
| | | /**
|
| | | * Does the user service support changes to user email address?
|
| | | * |
| | | * @return true or false
|
| | | * @since 1.0.0
|
| | | */
|
| | | @Override
|
| | | public boolean supportsEmailAddressChanges() {
|
| | | return false;
|
| | | }
|
| | |
|
| | | /**
|
| | | * Does the user service support changes to team memberships?
|
| | | *
|
| | | * @return true or false
|
| | |
| | | * @return cookie value
|
| | | */
|
| | | @Override
|
| | | public char[] getCookie(UserModel model) {
|
| | | public String getCookie(UserModel model) {
|
| | | if (!StringUtils.isEmpty(model.cookie)) {
|
| | | return model.cookie;
|
| | | }
|
| | | Properties allUsers = super.read();
|
| | | String value = allUsers.getProperty(model.username);
|
| | | String[] roles = value.split(",");
|
| | | String password = roles[0];
|
| | | String cookie = StringUtils.getSHA1(model.username + password);
|
| | | return cookie.toCharArray();
|
| | | return cookie;
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | // Permissions
|
| | | if (role.equalsIgnoreCase(Constants.ADMIN_ROLE)) {
|
| | | model.canAdmin = true;
|
| | | } else if (role.equalsIgnoreCase(Constants.FORK_ROLE)) {
|
| | | model.canFork = true;
|
| | | } else if (role.equalsIgnoreCase(Constants.NOT_FEDERATED_ROLE)) {
|
| | | model.excludeFromFederation = true;
|
| | | }
|
| | |
| | | if (model.canAdmin) {
|
| | | roles.add(Constants.ADMIN_ROLE);
|
| | | }
|
| | | if (model.canFork) {
|
| | | roles.add(Constants.FORK_ROLE);
|
| | | }
|
| | | if (model.excludeFromFederation) {
|
| | | roles.add(Constants.NOT_FEDERATED_ROLE);
|
| | | }
|