POST /coach/groups/:group_id/moderates
430048
def create
      authorize! :moderate, @group
      if @group.active_memberships.empty?
        redirect_to root_path, alert: "Could not log in as moderator "\
        "because there are no active memberships for this group."
      else
        sign_in @group.moderating_participant
        redirect_to social_networking.social_networking_profile_path
      end
    end
199203
def get_comments_are_moderated(instance):
    
    if not IS_INSTALLED:
        return False

    try:
        # Get the moderator which is installed for this model.
        mod = moderator._registry[instance.__class__]
    except KeyError:
        # No moderator = no moderation
        return False

    # Check the 'auto_moderate_field', 'moderate_after',
    # by reusing the basic Django policies.
    return CommentModerator.moderate(mod, None, instance, None)
1028709
function(uid, sid, groups) {
  if(!sid) {
    logger.warn('ignore uid %j for sid not specified.', uid);
    return false;
  }

  var group = groups[sid];
  if(!group) {
    group = [];
    groups[sid] = group;
  }

  group.push(uid);
  return true;
}
627726
def redirect_to_assignment_override_for_group(self, group_id, assignment_id):
        
        path = {}
        data = {}
        params = {}

        # REQUIRED - PATH - group_id
        """ID"""
        path["group_id"] = group_id

        # REQUIRED - PATH - assignment_id
        """ID"""
        path["assignment_id"] = assignment_id

        self.logger.debug("GET /api/v1/groups/{group_id}/assignments/{assignment_id}/override with query params: {params} and form data: {data}".format(params=params, data=data, **path))
        return self.generic_request("GET", "/api/v1/groups/{group_id}/assignments/{assignment_id}/override".format(**path), data=data, params=params, no_data=True)
982422
def add_member_to_group(self, group_id, user_id):
        
        url = self.TEAM_MEMBERS_URL % (group_id, user_id)

        connection = Connection(self.token)
        connection.set_url(self.production, url)

        return connection.post_request()
133840
def group_show(self, id, **kwargs):
        ""
        api_path = "/api/v2/groups/{id}.json"
        api_path = api_path.format(id=id)
        return self.call(api_path, **kwargs)
1231299
def create
      @group = Group.new(group_params)

      respond_to do |format|
        if @group.save
          format.html { redirect_to @group, notice: 'Group was successfully created.' }
          format.json { render :show, status: :created, location: @group }
        else
          format.html { render :new }
          format.json { render json: @group.errors, status: :unprocessable_entity }
        end
      end
    end
1297396
def register(self, model_or_iterable, moderation_class):
        
        if isinstance(model_or_iterable, ModelBase):
            model_or_iterable = [model_or_iterable]
        for model in model_or_iterable:
            if model in self._registry:
                raise AlreadyModerated(
                    "The model '%s' is already being moderated" % model._meta.verbose_name
                )
            self._registry[model] = moderation_class(model)
1089192
def update
      group = find_group
      group.update!(group_params)

      flash[:notice] = t("socializer.model.update", model: "Group")
      redirect_to group_path(group)
    end
1150852
def assign_perm(perm, user_or_group, forum=None, has_perm=True):
    
    user, group = get_identity(user_or_group)
    perm = ForumPermission.objects.get(codename=perm)
    if user:
        return UserForumPermission.objects.create(
            forum=forum,
            permission=perm,
            user=user if not user.is_anonymous else None,
            anonymous_user=user.is_anonymous,
            has_perm=has_perm,
        )
    if group:
        return GroupForumPermission.objects.create(
            forum=forum, permission=perm, group=group, has_perm=has_perm,
        )
1232181
public function postAdminAddGroup($id = null)
    {
        // Get user information
        $user = Sentinel::findById($id);

        if ($user == null)
        {
            // Prepare the error message
            $error = Lang::get('base.auth.not_found');
            return View('layouts.modal_confirmation', compact('title', 'message', 'error', 'model', 'confirm_route'));
        }

        $gid = Input::get('group');

        if ($gid == null)
        {
            // Prepare the error message
            $error = Lang::get('base.groups.not_found');
            return View('layouts.modal_confirmation', compact('title', 'message', 'error', 'model', 'confirm_route'));
        }

        // Get group information
        $group = Sentinel::findRoleById($gid);

        if ($group == null)
        {
            // Prepare the error message
            $error = Lang::get('base.groups.not_found');
            return View('layouts.modal_confirmation', compact('title', 'message', 'error', 'model', 'confirm_route'));
        }

        // Remove the group
        $group->users()->attach($user);

        // Prepare the success message
        $success = Lang::get('base.groups.added');

        // Redirect to the user management page
        return Redirect::route('users.update', $user->id)->with('success', $success);
    }
208369
def group_id(self, resource_id):
        
        if self._name != 'group':
            self._request_uri = '{}/{}'.format(self._api_uri, resource_id)
864433
@JsonIgnore
	public boolean isModerator() {
		return isAdmin() ? true : StringUtils.equalsIgnoreCase(this.groups, Groups.MODS.toString());
	}
1258919
def promote_to_admin(self, group_jid, peer_jid):
        
        log.info("[+] Promoting user {} to admin in group {}".format(peer_jid, group_jid))
        return self._send_xmpp_element(group_adminship.PromoteToAdminRequest(group_jid, peer_jid))
430366
def get_group_admin(self, group):
        
        data = {
            'name': group,
        }
        response = _fix_group(self.post('getGroupAdmin', data))
        return response
1116686
private function adminUpdateGroup()
    {
        $item = $this->dbItem('groups', arg('id', 'int'));

        $item['title'] = arg('title', 'dbsafe');
        $item['description'] = arg('description', 'dbsafe');

        $this->dbUpdate('groups', $item);

        $url = arg('submitURL');
        if (strpos($url, '=group') === false)
        {
            $url .= '&action=group';
        }

        HTTP::redirect($url);
    }
932437
def group_memberships_assignable(self, group_id, **kwargs):
        ""
        api_path = "/api/v2/groups/{group_id}/memberships/assignable.json"
        api_path = api_path.format(group_id=group_id)
        return self.call(api_path, **kwargs)