GUACAMOLE-292: Define and use standard attributes for user organization and role.

This commit is contained in:
Michael Jumper
2017-02-24 01:54:41 -08:00
parent 9634731fe6
commit ee6edb9c82
4 changed files with 46 additions and 4 deletions

View File

@@ -114,7 +114,9 @@ public class ModeledUser extends ModeledDirectoryObject<UserModel> implements Us
*/ */
public static final Form PROFILE = new Form("profile", Arrays.<Field>asList( public static final Form PROFILE = new Form("profile", Arrays.<Field>asList(
new TextField(User.Attribute.FULL_NAME), new TextField(User.Attribute.FULL_NAME),
new EmailField(User.Attribute.EMAIL_ADDRESS) new EmailField(User.Attribute.EMAIL_ADDRESS),
new TextField(User.Attribute.ORGANIZATION),
new TextField(User.Attribute.ORGANIZATIONAL_ROLE)
)); ));
/** /**
@@ -400,6 +402,12 @@ public class ModeledUser extends ModeledDirectoryObject<UserModel> implements Us
// Set email address attribute // Set email address attribute
attributes.put(User.Attribute.EMAIL_ADDRESS, "test@test.test"); // TODO attributes.put(User.Attribute.EMAIL_ADDRESS, "test@test.test"); // TODO
// Set organization attribute
attributes.put(User.Attribute.ORGANIZATION, "Example, Inc."); // TODO
// Set role attribute
attributes.put(User.Attribute.ORGANIZATIONAL_ROLE, "Senior Lead Architect"); // TODO
} }
/** /**
@@ -523,6 +531,12 @@ public class ModeledUser extends ModeledDirectoryObject<UserModel> implements Us
// Translate email address attribute // Translate email address attribute
logger.info("EMAIL ADDRESS: \"{}\"", attributes.get(User.Attribute.EMAIL_ADDRESS)); // TODO logger.info("EMAIL ADDRESS: \"{}\"", attributes.get(User.Attribute.EMAIL_ADDRESS)); // TODO
// Translate organization attribute
logger.info("ORGANIZATION: \"{}\"", attributes.get(User.Attribute.ORGANIZATION)); // TODO
// Translate role attribute
logger.info("ORGANIZATIONAL ROLE: \"{}\"", attributes.get(User.Attribute.ORGANIZATIONAL_ROLE)); // TODO
} }
@Override @Override

View File

@@ -49,6 +49,17 @@ public interface User extends Identifiable {
*/ */
public static String EMAIL_ADDRESS = "guac-email-address"; public static String EMAIL_ADDRESS = "guac-email-address";
/**
* The organization, company, group, etc. that the user belongs to.
*/
public static String ORGANIZATION = "guac-organization";
/**
* The role that the user has at the organization, company, group, etc.
* they belong to.
*/
public static String ORGANIZATIONAL_ROLE = "guac-organizational-role";
} }
/** /**

View File

@@ -85,7 +85,22 @@ angular.module('rest').factory('User', [function defineUser() {
* *
* @type String * @type String
*/ */
EMAIL_ADDRESS : 'guac-email-address' EMAIL_ADDRESS : 'guac-email-address',
/**
* The organization, company, group, etc. that the user belongs to.
*
* @type String
*/
ORGANIZATION : 'guac-organization',
/**
* The role that the user has at the organization, company, group, etc.
* they belong to.
*
* @type String
*/
ORGANIZATIONAL_ROLE : 'guac-organizational-role'
}; };

View File

@@ -699,8 +699,10 @@
"USER_ATTRIBUTES" : { "USER_ATTRIBUTES" : {
"FIELD_HEADER_GUAC_EMAIL_ADDRESS" : "Email address:", "FIELD_HEADER_GUAC_EMAIL_ADDRESS" : "Email address:",
"FIELD_HEADER_GUAC_FULL_NAME" : "Full name:" "FIELD_HEADER_GUAC_FULL_NAME" : "Full name:",
"FIELD_HEADER_GUAC_ORGANIZATION" : "Organization:",
"FIELD_HEADER_GUAC_ORGANIZATIONAL_ROLE" : "Role:"
}, },