@Override public String toString() { return "GroupByDomain [" + this.getIdentifier() + "]"; } }
@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(); } } }
acl.grantPermission(new GroupByDomainGrantee("yourdomain.com"), Permission.PERMISSION_WRITE);
@Override public String toString() { return "GroupByDomain [" + this.getIdentifier() + "]"; } }
acl.grantPermission(new GroupByDomainGrantee("yourdomain.com"), Permission.PERMISSION_WRITE);
@Override public XMLBuilder toXMLBuilder() throws TransformerException, ParserConfigurationException, FactoryConfigurationError { return (XMLBuilder.create("Scope") .attr("type", "GroupByDomain") .element("Domain").text(this.getIdentifier()) ); }
list.grantPermission(new GroupByDomainGrantee(userAndRole.getUser().getIdentifier()), Permission.parsePermission(userAndRole.getRole().getName()));
@Override public XMLBuilder toXMLBuilder() throws TransformerException, ParserConfigurationException, FactoryConfigurationError { return (XMLBuilder.create("Scope") .attr("type", "GroupByDomain") .element("Domain").text(this.getIdentifier()) ); }