/** * Sets the workflow's organization. * * @param organization * the organization */ public void setOrganization(Organization organization) { if (organization == null) this.organization = null; else this.organization = JaxbOrganization.fromOrganization(organization); }
@Override public JaxbOrganization marshal(Organization org) throws Exception { if (org == null) return null; if (org instanceof JaxbOrganization) return (JaxbOrganization) org; return JaxbOrganization.fromOrganization(org); }
public void add(Organization org) { if (org instanceof JaxbOrganization) { organizations.add((JaxbOrganization) org); } else { organizations.add(JaxbOrganization.fromOrganization(org)); } }
@Override public JaxbRole apply(String role, Organization organization) { return new JaxbRole(role, JaxbOrganization.fromOrganization(organization)); } };
public User toUser(final String providerName) { Set<JaxbRole> roleSet = new HashSet<JaxbRole>(); for (JpaRole role : roles) { roleSet.add(JaxbRole.fromRole(role)); } return new JaxbUser(username, null, name, email, providerName, JaxbOrganization.fromOrganization(organization), roleSet); }
@Override public Iterator<User> findUsers(String query, int offset, int limit) { if (query == null) throw new IllegalArgumentException("Query must be set"); if (query.endsWith("%")) { query = query.substring(0, query.length() - 1); } if (query.isEmpty()) { return Collections.emptyIterator(); } // Verify if a user exists (non-wildcard searches only) if (!verifySakaiUser(query)) { return Collections.emptyIterator(); } List<User> users = new LinkedList<User>(); JaxbOrganization jaxbOrganization = JaxbOrganization.fromOrganization(organization); JaxbUser queryUser = new JaxbUser(query, PROVIDER_NAME, jaxbOrganization, new HashSet<JaxbRole>()); users.add(queryUser); return users.iterator(); }
this.instructorRoles = instructorRoles; JaxbOrganization jaxbOrganization = JaxbOrganization.fromOrganization(organization);
@GET @Path("{id}.xml") @Produces(MediaType.TEXT_XML) @RestQuery(name = "orgasxml", description = "Gets an organizations as xml", returnDescription = "The org as xml", pathParameters = { @RestParameter(name = "id", type = Type.STRING, description = "The job identifier", isRequired = true) }, reponses = { @RestResponse(responseCode = 200, description = "Organization returned"), @RestResponse(responseCode = 404, description = "No organization with this identifier found") }) public JaxbOrganization getOrganizationAsXml(@PathParam("id") String id) { try { return JaxbOrganization.fromOrganization(orgDirectoryService.getOrganization(id)); } catch (NotFoundException e) { return null; } }
JaxbOrganization jaxbOrganization = JaxbOrganization.fromOrganization(organization);
JaxbOrganization jaxbOrganization = JaxbOrganization.fromOrganization(organization); if (ltirole) {
this.creator = creator; if (organization != null) this.organization = JaxbOrganization.fromOrganization(organization); this.state = WorkflowState.INSTANTIATED; this.mediaPackage = mediaPackage;
/** * Create the global anonymous user with the given organization. * * @param org * the organization * @return the global anonymous user */ public static User createAnonymousUser(Organization org) { JaxbOrganization jaxbOrganization = JaxbOrganization.fromOrganization(org); return new JaxbUser(GLOBAL_ANONYMOUS_USERNAME, null, jaxbOrganization, new JaxbRole( jaxbOrganization.getAnonymousRole(), jaxbOrganization)); }
JaxbOrganization jaxbOrganization = JaxbOrganization.fromOrganization(organization);
public static JaxbGroup fromGroup(Group group) { JaxbOrganization organization = JaxbOrganization.fromOrganization(group.getOrganization()); Set<JaxbRole> roles = new HashSet<JaxbRole>(); for (Role role : group.getRoles()) { if (role instanceof JaxbRole) { roles.add((JaxbRole) role); } else { roles.add(JaxbRole.fromRole(role)); } } return new JaxbGroup(group.getGroupId(), organization, group.getName(), group.getDescription(), roles, group.getMembers()); }
JaxbOrganization jaxbOrganization = JaxbOrganization.fromOrganization(org); if (auth != null) { Object principal = auth.getPrincipal();
JaxbOrganization jaxbOrganization = JaxbOrganization.fromOrganization(organization);
public static JaxbRole fromRole(Role role) { if (role instanceof JaxbRole) return (JaxbRole) role; JaxbOrganization org = JaxbOrganization.fromOrganization(role.getOrganization()); return new JaxbRole(role.getName(), org, role.getDescription(), role.getType()); }
/** * Create a system user for the given organization with global and organization local admin role. Get the * <code>systemUserName</code> from the global config where it is stored under {@link #PROPERTY_KEY_SYS_USER}. In an * OSGi environment this is typically done calling * <code>componentContext.getBundleContext().getProperty(PROPERTY_KEY_SYS_USER)</code>. * * @see #createSystemUser(org.osgi.service.component.ComponentContext, org.opencastproject.security.api.Organization) */ public static User createSystemUser(String systemUserName, Organization org) { JaxbOrganization jaxbOrganization = JaxbOrganization.fromOrganization(org); return new JaxbUser(systemUserName, null, jaxbOrganization, new JaxbRole(GLOBAL_ADMIN_ROLE, jaxbOrganization), new JaxbRole(org.getAdminRole(), jaxbOrganization)); }
JaxbOrganization.fromOrganization(requestedUser.getOrganization()), Stream.$(requestedRoles).map(toJaxbRole._2(requestedOrganization)).toSet()); logger.trace("Request roles '{}' are amended to user '{}'", rolesHeader, requestedUser.getUsername());
/** * Creates a JAXB user from a regular user object with an additional set of roles. * * @param user * the user * @return the JAXB user */ public static JaxbUser fromUser(User user, Collection<? extends Role> extraRoles) { Set<JaxbRole> roles = new HashSet<JaxbRole>(); for (Role role : user.getRoles()) { roles.add(JaxbRole.fromRole(role)); } for (Role role : extraRoles) { roles.add(JaxbRole.fromRole(role)); } JaxbUser jaxbUser = new JaxbUser(user.getUsername(), user.getPassword(), user.getName(), user.getEmail(), user.getProvider(), user.canLogin(), JaxbOrganization.fromOrganization(user.getOrganization()), roles); jaxbUser.setManageable(user.isManageable()); return jaxbUser; }