@Override public String toString() { return "UserByEmail [email=" + getIdentifier() + (name != null ? ", name=" + getName() : "") + "]"; } }
public UserByEmailAddressGrantee(String emailAddress, String name) { super(emailAddress); setName(name); }
@Override public void startElement(String name, Attributes attrs) { if (name.equals("Owner")) { owner = new GSOwner(); } else if (name.equals("Entries")) { accessControlList = new GSAccessControlList(); accessControlList.setOwner(owner); insideACL = true; } else if (name.equals("Scope")) { scopeType = attrs.getValue("type"); if (scopeType.equals("UserById")) { currentGrantee = new UserByIdGrantee(); } else if (scopeType.equals("UserByEmail")) { currentGrantee = new UserByEmailAddressGrantee(); } else if (scopeType.equals("GroupById")) { currentGrantee = new GroupByIdGrantee(); } else if (scopeType.equals("GroupByEmail")) { currentGrantee = new GroupByEmailAddressGrantee(); } else if (scopeType.equals("GroupByDomain")) { currentGrantee = new GroupByDomainGrantee(); } else if (scopeType.equals("AllUsers")) { currentGrantee = new AllUsersGrantee(); } else if (scopeType.equals("AllAuthenticatedUsers")) { currentGrantee = new AllAuthenticatedUsersGrantee(); } } }
@Override public void startElement(String name, Attributes attrs) { if (name.equals("Owner")) { owner = new GSOwner(); } else if (name.equals("Entries")) { accessControlList = new GSAccessControlList(); accessControlList.setOwner(owner); insideACL = true; } else if (name.equals("Scope")) { scopeType = attrs.getValue("type"); if (scopeType.equals("UserById")) { currentGrantee = new UserByIdGrantee(); } else if (scopeType.equals("UserByEmail")) { currentGrantee = new UserByEmailAddressGrantee(); } else if (scopeType.equals("GroupById")) { currentGrantee = new GroupByIdGrantee(); } else if (scopeType.equals("GroupByEmail")) { currentGrantee = new GroupByEmailAddressGrantee(); } else if (scopeType.equals("GroupByDomain")) { currentGrantee = new GroupByDomainGrantee(); } else if (scopeType.equals("AllUsers")) { currentGrantee = new AllUsersGrantee(); } else if (scopeType.equals("AllAuthenticatedUsers")) { currentGrantee = new AllAuthenticatedUsersGrantee(); } } }
@Override public String toString() { return "UserByEmail [email=" + getIdentifier() + (name != null ? ", name=" + getName() : "") + "]"; } }
acl.grantPermission(new UserByEmailAddressGrantee("someone@somewhere.com"), Permission.PERMISSION_FULL_CONTROL);
public UserByEmailAddressGrantee(String emailAddress, String name) { super(emailAddress); setName(name); }
@Override public XMLBuilder toXMLBuilder() throws TransformerException, ParserConfigurationException, FactoryConfigurationError { XMLBuilder builder = XMLBuilder.create("Scope") .attr("type", "UserByEmail") .element("EmailAddress").text(getIdentifier()).up(); if (getName() != null) { builder.element("Name").text(getName()); } return builder; }
acl.grantPermission(new UserByEmailAddressGrantee("someone@somewhere.com"), Permission.PERMISSION_FULL_CONTROL);
((UserByIdGrantee) currentGrantee).setName(elementText); } else if (currentGrantee instanceof UserByEmailAddressGrantee) { ((UserByEmailAddressGrantee) currentGrantee).setName(elementText); } else if (currentGrantee instanceof GroupByIdGrantee) { ((GroupByIdGrantee) currentGrantee).setName(elementText);
@Override public XMLBuilder toXMLBuilder() throws TransformerException, ParserConfigurationException, FactoryConfigurationError { XMLBuilder builder = XMLBuilder.create("Scope") .attr("type", "UserByEmail") .element("EmailAddress").text(getIdentifier()).up(); if (getName() != null) { builder.element("Name").text(getName()); } return builder; }
list.grantPermission(new UserByEmailAddressGrantee(userAndRole.getUser().getIdentifier()), Permission.parsePermission(userAndRole.getRole().getName()));
((UserByIdGrantee) currentGrantee).setName(elementText); } else if (currentGrantee instanceof UserByEmailAddressGrantee) { ((UserByEmailAddressGrantee) currentGrantee).setName(elementText); } else if (currentGrantee instanceof GroupByIdGrantee) { ((GroupByIdGrantee) currentGrantee).setName(elementText);