org.sakaiproject.site.api.Group.getReference()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(8.5k)|赞(0)|评价(0)|浏览(78)

本文整理了Java中org.sakaiproject.site.api.Group.getReference()方法的一些代码示例,展示了Group.getReference()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Group.getReference()方法的具体详情如下:
包路径:org.sakaiproject.site.api.Group
类名称:Group
方法名:getReference

Group.getReference介绍

暂无

代码示例

代码示例来源:origin: org.sakaiproject.kernel/sakai-kernel-impl

/**
 * Test a collection of Group object for the specified group reference
 * @param groups The collection (Group) of groups
 * @param groupRef The string group reference to find.
 * @return true if found, false if not.
 */
protected boolean groupCollectionContainsRefString(Collection<Group> groups, String groupRef)
{
  for (Iterator<Group> i = groups.iterator(); i.hasNext();)
  {
    Group group = (Group) i.next();
    if (group.getReference().equals(groupRef)) return true;
  }
  return false;
}

代码示例来源:origin: sakaiproject/sakai

/**
 * Test a collection of Group object for the specified group reference
 * @param groups The collection (Group) of groups
 * @param groupRef The string group reference to find.
 * @return true if found, false if not.
 */
protected boolean groupCollectionContainsRefString(Collection groups, String groupRef)
{
  for (Iterator i = groups.iterator(); i.hasNext();)
  {
    Group group = (Group) i.next();
    if (group.getReference().equals(groupRef)) return true;
  }
  return false;
}

代码示例来源:origin: org.sakaiproject.message/sakai-message-util

/**
 * Test a collection of Group object for the specified group reference
 * @param groups The collection (Group) of groups
 * @param groupRef The string group reference to find.
 * @return true if found, false if not.
 */
protected boolean groupCollectionContainsRefString(Collection groups, String groupRef)
{
  for (Iterator i = groups.iterator(); i.hasNext();)
  {
    Group group = (Group) i.next();
    if (group.getReference().equals(groupRef)) return true;
  }
  return false;
}

代码示例来源:origin: org.sakaiproject.message/sakai-message-impl

/**
 * Test a collection of Group object for the specified group reference
 * @param groups The collection (Group) of groups
 * @param groupRef The string group reference to find.
 * @return true if found, false if not.
 */
protected boolean groupCollectionContainsRefString(Collection groups, String groupRef)
{
  for (Iterator i = groups.iterator(); i.hasNext();)
  {
    Group group = (Group) i.next();
    if (group.getReference().equals(groupRef)) return true;
  }
  return false;
}

代码示例来源:origin: org.sakaiproject.message/sakai-message-impl

/**
 * See if the collection of group reference strings has at least one group that is in the collection of Group objects.
 * 
 * @param groupRefs
 *        The collection (String) of group references.
 * @param groups
 *        The collection (Group) of group objects.
 * @return true if there is interesection, false if not.
 */
protected boolean isIntersectionGroupRefsToGroups(Collection groupRefs, Collection groups)
{
  for (Iterator iRefs = groupRefs.iterator(); iRefs.hasNext();)
  {
    String findThisGroupRef = (String) iRefs.next();
    for (Iterator iGroups = groups.iterator(); iGroups.hasNext();)
    {
      String thisGroupRef = ((Group) iGroups.next()).getReference();
      if (thisGroupRef.equals(findThisGroupRef))
      {
        return true;
      }
    }
  }
  return false;
}

代码示例来源:origin: org.sakaiproject.message/sakai-message-util

/**
 * See if the collection of group reference strings has at least one group that is in the collection of Group objects.
 * 
 * @param groupRefs
 *        The collection (String) of group references.
 * @param groups
 *        The collection (Group) of group objects.
 * @return true if there is interesection, false if not.
 */
protected boolean isIntersectionGroupRefsToGroups(Collection groupRefs, Collection groups)
{
  for (Iterator iRefs = groupRefs.iterator(); iRefs.hasNext();)
  {
    String findThisGroupRef = (String) iRefs.next();
    for (Iterator iGroups = groups.iterator(); iGroups.hasNext();)
    {
      String thisGroupRef = ((Group) iGroups.next()).getReference();
      if (thisGroupRef.equals(findThisGroupRef))
      {
        return true;
      }
    }
  }
  return false;
}

代码示例来源:origin: sakaiproject/sakai

/**
 * See if the collection of group reference strings has at least one group that is in the collection of Group objects.
 * 
 * @param groupRefs
 *        The collection (String) of group references.
 * @param groups
 *        The collection (Group) of group objects.
 * @return true if there is interesection, false if not.
 */
protected boolean isIntersectionGroupRefsToGroups(Collection groupRefs, Collection groups)
{
  for (Iterator iRefs = groupRefs.iterator(); iRefs.hasNext();)
  {
    String findThisGroupRef = (String) iRefs.next();
    for (Iterator iGroups = groups.iterator(); iGroups.hasNext();)
    {
      String thisGroupRef = ((Group) iGroups.next()).getReference();
      if (thisGroupRef.equals(findThisGroupRef))
      {
        return true;
      }
    }
  }
  return false;
}

代码示例来源:origin: org.sakaiproject.assignment/sakai-assignment-impl

/**
 * See if the collection of group reference strings has at least one group that is in the collection of Group objects.
 * 
 * @param groupRefs
 *        The collection (String) of group references.
 * @param groups
 *        The collection (Group) of group objects.
 * @return true if there is interesection, false if not.
 */
protected boolean isIntersectionGroupRefsToGroups(Collection groupRefs, Collection groups)
{    
  for (Iterator iRefs = groupRefs.iterator(); iRefs.hasNext();)
  {
    String findThisGroupRef = (String) iRefs.next();
    for (Iterator iGroups = groups.iterator(); iGroups.hasNext();)
    {
      String thisGroupRef = ((Group) iGroups.next()).getReference();
      if (thisGroupRef.equals(findThisGroupRef))
      {
        return true;
      }
    }
  }
  return false;
}

代码示例来源:origin: org.sakaiproject.kernel/sakai-kernel-impl

/**
 * {@inheritDoc}
 */
public Collection<String> getMembersInGroups(Set<String> groupIds) {
  @SuppressWarnings("unchecked")
  Collection<Group> siteGroups = getGroups();
  HashSet<String> siteGroupRefs = new HashSet<String>(siteGroups.size());
  for (Group group : siteGroups) {
    if (groupIds == null || // null groupIds includes all groups in the site
        groupIds.contains(group.getId())) {
      siteGroupRefs.add(group.getReference());
    }
  }
  Collection<String> membersInGroups = authzGroupService.getAuthzUsersInGroups(siteGroupRefs);
  return membersInGroups;
}

代码示例来源:origin: org.sakaiproject.kernel/sakai-kernel-impl

/**
 * {@inheritDoc}
 */
public Collection getGroupsWithMemberHasRole(String userId, String role)
{
  Collection siteGroups = getGroups();
  ArrayList<String> siteGroupRefs = new ArrayList<String>(siteGroups.size());
  for ( Iterator it=siteGroups.iterator(); it.hasNext(); )
    siteGroupRefs.add( ((Group)it.next()).getReference() );
    
  List groups = authzGroupService.getAuthzUserGroupIds(siteGroupRefs, userId);
  Collection<Group> rv = new Vector<Group>();
  for (Iterator i = groups.iterator(); i.hasNext();)
  {
    Member m = null;
    Group g = getGroup( (String)i.next() );
    if ( g != null )
      m = g.getMember(userId);
    if ((m != null) && (m.isActive()) && (m.getRole().getId().equals(role)))
      rv.add(g);
  }
  return rv;
}

代码示例来源:origin: org.sakaiproject.kernel/sakai-kernel-impl

/**
 * Disable the site and site group azgs for a site that's being deleted.
 * 
 * @param site
 *        The site.
 */
protected void disableAzg(Site site)
{
  // disable a realm for each group
  for (Iterator iGroups = site.getGroups().iterator(); iGroups.hasNext();)
  {
    Group group = (Group) iGroups.next();
    disableAuthorizationGroup(group.getReference());
  }
  // disable realm last, to keep those permissions around
  disableAuthorizationGroup(site.getReference());
}

代码示例来源:origin: org.sakaiproject.kernel/sakai-kernel-impl

ArrayList<String> siteGroupRefs = new ArrayList<String>(siteGroups.size());
for ( Iterator it=siteGroups.iterator(); it.hasNext(); )
  siteGroupRefs.add( ((Group)it.next()).getReference() );

代码示例来源:origin: org.sakaiproject.kernel/sakai-kernel-impl

/** 
 * Determine whether current user can update the group assignments (add/remove groups) for a specified resource.
 * This is based on whether the user has adequate rights defined for the group (AUTH_RESOURCE_ADD) or for the 
 * containing collection of the resource (AUTH_RESOURCE_ADD).  
 * @param group The group ionvolved in the query.
 * @param resourceRef A reference string for the resource.
 * @return true if allowed, false otherwise.
 */
protected boolean allowGroupUpdate(Group group, String resourceRef)
{
  String collectionId = getContainingCollectionId(resourceRef);
  return unlockCheck(AUTH_RESOURCE_ADD, group.getReference()) || unlockCheck(AUTH_RESOURCE_ADD, collectionId);
}

代码示例来源:origin: org.sakaiproject.assignment/sakai-assignment-impl

if (aGroups.contains(g.getReference()))

代码示例来源:origin: org.sakaiproject.kernel/sakai-kernel-impl

groupRefs.add(group.getReference());
groupRef = ((Group) obj).getReference();

代码示例来源:origin: sakaiproject/sakai

groupRefs.add(group.getReference());
if (groupRefs.contains(group.getReference()))

代码示例来源:origin: org.sakaiproject.message/sakai-message-util

groupRefs.add(group.getReference());
if (groupRefs.contains(group.getReference()))

代码示例来源:origin: org.sakaiproject/sakai-rwiki-impl

pageName = group.getReference() + "/"; //$NON-NLS-1$
pageName += "section/" + group.getTitle() + "/Home"; //$NON-NLS-1$ //$NON-NLS-2$

代码示例来源:origin: org.sakaiproject.message/sakai-message-impl

groupRefs.add(group.getReference());
if (groupRefs.contains(group.getReference()))

代码示例来源:origin: org.sakaiproject.kernel/sakai-kernel-impl

enableAuthorizationGroup(group.getReference(), groupAzgTemplate, null, "!group.template");
disableAuthorizationGroup(group.getReference());

相关文章