Gives the role of owner for a user in the current channel.
762510
def channels_add_owner(self, room_id, user_id=None, username=None, **kwargs):
        """"""
        if user_id:
            return self.__call_api_post('channels.addOwner', roomId=room_id, userId=user_id, kwargs=kwargs)
        elif username:
            return self.__call_api_post('channels.addOwner', roomId=room_id, username=username, kwargs=kwargs)
        else:
            raise RocketMissingParamException('userID or username required')
241926
@Override
    public void setOwner(ApiBaseUser owner) {
        room.setOwner(CommandUtil.getSfsUser(owner, api));
        apiRoom.setOwner(owner);
    }
2116
public void setOwner(String src, String username, String group
  ) throws IOException {
    INode[] inodes = null;
    writeLock();
    try {
      if (isInSafeMode()) {
        throw new SafeModeException("Cannot set permission for " + src, safeMode);
      }
      inodes = dir.getExistingPathINodes(src);
      if (isPermissionCheckingEnabled(inodes)) {
        FSPermissionChecker pc = checkOwner(src, inodes);
        if (!pc.isSuper) {
          if (username != null && !pc.user.equals(username)) {
            if (this.permissionAuditOnly) {
              // do not throw the exception, we would like to only log.
              LOG.warn("PermissionAudit failed on " + src + 
                  ": non-super user cannot change owner.");
            } else {
              throw new AccessControlException("Non-super user cannot change owner.");
            }
          }
          if (group != null && !pc.containsGroup(group)) {
            if (this.permissionAuditOnly) {
              // do not throw the exception, we would like to only log.
              LOG.warn("PermissionAudit failed on " + src + 
                  ": user does not belong to " + group + " .");
            } else {
              throw new AccessControlException("User does not belong to " + group
                  + " .");
            }
          }
        }
      }
      dir.setOwner(src, username, group);
    } finally {
      writeUnlock();
    }
    getEditLog().logSync(false);
    if (auditLog.isInfoEnabled()) {
      logAuditEvent(getCurrentUGI(),
        Server.getRemoteIp(),
        "setOwner", src, null, getLastINode(inodes));
    }
  }
1168742
def owner_active?(feature, owner)
      redis.sismember(owner_key(feature, owner), owner.id)
    end
513608
def add_tenant_user_role(request, project=None, user=None, role=None,
                         group=None, domain=None):
    """"""
    manager = keystoneclient(request, admin=True).roles
    if VERSIONS.active < 3:
        manager.add_user_role(user, role, project)
    else:
        manager.grant(role, user=user, project=project,
                      group=group, domain=domain)
537423
public void init(ListenerOwner owner)
    {
        m_owner = owner;
        m_nextListener = null;
        m_bEnabled = true;
        m_dependentListener = null;
        m_dependentStateListener = null;
        if (owner != null)
            owner.addListener(this);
    }
1133791
def is_owned_by_current_user(self):
        

        from bambou.nurest_root_object import NURESTRootObject
        root_object = NURESTRootObject.get_default_root_object()
        return self._owner == root_object.id
619275
private Persona establishOwner(org.hawkular.accounts.api.model.Resource resource, Persona current) {
        while (resource != null && resource.getPersona() == null) {
            resource = resource.getParent();
        }

        if (resource != null && resource.getPersona().equals(current)) {
            current = null;
        }

        return current;
    }
561602
def show_channel(self, channel, owner):
        '''
        '''
        url = '%s/channels/%s/%s' % (self.domain, owner, channel)

        res = self.session.get(url)
        self._check_response(res, [200])
        return res.json()
1046314
public void setOwner(ListenerOwner owner)
    {
        super.setOwner(owner);
        if (this.getOwner() != null)
            this.getOwner().setOpenMode(this.getOwner().getOpenMode() | DBConstants.OPEN_REFRESH_AND_LOCK_ON_CHANGE_STRATEGY);    // Make sure keys are updated before sync
    }
335933
public void setOwner(ListenerOwner owner)
    {
        super.setOwner(owner);
        if (this.getOwner() != null)
            this.syncBehaviorToRecord(this.getOwner().getRecord().getField(m_iMainFilesFieldSeq));  // Init now
    }
223082
def load_owner
      unless params[:owner_id].nil?
        if current_owner.present?

          # we need to try and look this owner up via the find method so that we're
          # taking advantage of any override of the find method that would be provided
          # by older versions of friendly_id. (support for newer versions default behavior
          # below.)
          searched_owner = current_owner.class.find(params[:owner_id]) rescue nil

          # if we couldn't find them that way, check whether there is a new version of
          # friendly_id in place that we can use to look them up by their slug.
          # in christoph's words, "why?!" in my words, "warum?!!!"
          # (we debugged this together on skype.)
          if searched_owner.nil? && current_owner.class.respond_to?(:friendly)
            searched_owner = current_owner.class.friendly.find(params[:owner_id]) rescue nil
          end

          if current_owner.try(:id) == searched_owner.try(:id)
            @owner = current_owner
          else
            customer = Subscription.find_customer(searched_owner)
            customer_2 = Subscription.find_customer(current_owner)
            # susbscription we are looking for belongs to the same user but to a different
            # subscription owner
            # e.g. user -> account -> subscription
            # same user but different accounts for example

            if customer_2.try(:id) == customer.try(:id)
              @owner = searched_owner
            else
              return unauthorized
            end
          end
        else
          return unauthorized
        end
      end
    end
635385
public void setOwner(ListenerOwner owner)
    {
        super.setOwner(owner);
        if (owner != null) if (m_recordToSync != null)
            m_recordToSync.addListener(new FileRemoveBOnCloseHandler(this));
    }
100103
def is_owner(self, user):
        
        if user.is_authenticated:
            return self.created_by.id == user.id
        return False
788048
def owner_type(self, value):
        
        self._owner_type = value
        if value == 'User':
            self._fields['owner'] = entity_fields.OneToOneField(User)
            if hasattr(self, 'owner'):
                # pylint:disable=no-member
                self.owner = User(
                    self._server_config,
                    id=self.owner.id if isinstance(self.owner, Entity)
                    else self.owner
                )
        elif value == 'Usergroup':
            self._fields['owner'] = entity_fields.OneToOneField(UserGroup)
            if hasattr(self, 'owner'):
                # pylint:disable=no-member
                self.owner = UserGroup(
                    self._server_config,
                    id=self.owner.id if isinstance(self.owner, Entity)
                    else self.owner
                )
346075
public void setOwner(ListenerOwner owner)
    {
        super.setOwner(owner);
        if (owner != null)
        {
            if (m_converterSource == null)
                m_converterSource = this.getOwner();
            if (m_converterDest != null)
                if (m_converterDest.getField() != null)
                    if (m_converterSource.getField() == this.getOwner())    // Always!
                        if (((BaseField)m_converterDest.getField()).getRecord() != this.getOwner().getRecord())
            { // Not same file, if target file closes, remove this listener!
                ((BaseField)m_converterDest.getField()).getRecord().addListener(new FileRemoveBOnCloseHandler(this));
            }
        }
        else if (m_bFreeChainedConverters)
        {   // Free all the converters in the chain
            while ((m_converterDest != null) && (m_converterDest != m_converterDest.getField()))
            {
                Converter converterNext = null;
                if (m_converterDest instanceof FieldConverter)
                    converterNext = ((FieldConverter)m_converterDest).getNextConverter();
                m_converterDest.free();
                m_converterDest = converterNext;
            }
            while ((m_converterSource != null) && (m_converterSource != m_converterSource.getField()))
            {
                Converter converterNext = null;
                if (m_converterSource instanceof FieldConverter)
                    converterNext = ((FieldConverter)m_converterSource).getNextConverter();
                m_converterSource.free();
                m_converterSource = converterNext;
            }
        }
    }
1101045
public void setOwner(ListenerOwner owner)
    {
        super.setOwner(owner);
        if (owner != null) if (m_fldToDisable != null)
            if (this.getOwner().getRecord() != m_fldToDisable.getRecord())
                m_fldToDisable.addListener(new FieldRemoveBOnCloseHandler(this)); // Make sure you remove this listener if m_fldToDisable is gone.
        if (owner != null)
            if (m_fldToDisable == null)
                m_fldToDisable = this.getOwner();
        if (owner != null)
            this.fieldChanged(DBConstants.DONT_DISPLAY, DBConstants.INIT_MOVE);
        if (owner == null)
            m_fldToDisable.setEnabled(true);    // Remove the behavior = reenable the field
    }