Only talk owners can see talks, unless they've been accepted
438317
def get_object(self, *args, **kwargs):
        ''''''
        object_ = super(TalkView, self).get_object(*args, **kwargs)
        if not object_.can_view(self.request.user):
            raise PermissionDenied
        return object_
458125
protected boolean onlyVisibleForOU(CmsUUID userId) {

        try {
            if (m_app.isOUManagable(m_cms.readUser(userId).getOuFqn())) {
                return true;
            }
        } catch (CmsException e) {
            //
        }
        return false;
    }
288768
def befriend(self, other_agent, force=False):
        '''
        
        '''
        if force or self['openness'] > random():
            self.env.add_edge(self, other_agent)
            self.info('Made some friend {}'.format(other_agent))
            return True
        return False
784586
def can_read(self):
        
        sm = getSecurityManager()
        if not sm.checkPermission(permissions.View, self.context):
            return False
        return True
63385
public void setOwner(ListenerOwner owner)
    {
        if (owner == null)
        {
            if (m_messageListener != null)
            {
                m_messageListener.free();
                m_messageListener = null;
            }
        }
        super.setOwner(owner);
        if (owner != null)
        {
            Record record = this.getOwner().getRecord();
            MessageManager messageManager = ((Application)record.getTask().getApplication()).getMessageManager();
            if (messageManager != null)
            {
                BaseMessageFilter messageFilter = new BaseMessageFilter(MessageConstants.TRX_RETURN_QUEUE, MessageConstants.INTERNET_QUEUE, this, null);
                messageManager.addMessageFilter(messageFilter);
                m_messageListener = new  WaitForFieldChangeMessageListener(messageFilter, this);
                record.setupRecordListener(m_messageListener, false, false);   // I need to listen for record changes
            }
        }            
    }
968096
def notify_owner(plugin, vc_room):
    """"""
    user = vc_room.vidyo_extension.owned_by_user
    tpl = get_plugin_template_module('emails/remote_deleted.html', plugin=plugin, vc_room=vc_room, event=None,
                                     vc_room_event=None, user=user)
    _send('delete', user, plugin, None, vc_room, tpl)
1047192
def perform_permissions_check(self, user, obj, perms):
        
        return self.request.forum_permission_handler.can_update_topics_to_sticky_topics(obj, user)
966900
def accept(self):
        """"""
        socket = Socket(self._llc, None)
        socket._tco = self.llc.accept(self._tco)
        return socket
1314645
private void enableTalkBack() {
        GVRSceneObject[] sceneObjects = mGvrContext.getMainScene().getWholeSceneObjects();
        for (GVRSceneObject sceneObject : sceneObjects) {
            if (sceneObject instanceof GVRAccessiblityObject)
                if (((GVRAccessiblityObject) sceneObject).getTalkBack() != null)
                    ((GVRAccessiblityObject) sceneObject).getTalkBack().setActive(true);
        }
    }
880192
def only_manager(self):
        """"""
        assert len(self.managers) == 1, MULTIPLE_MANAGERS_MESSAGE
        return list(self.managers.values())[0]
883034
def Chat(self, Name=''):
        
        o = Chat(self, Name)
        o.Status # Tests if such a chat really exists.
        return o
889560
def can_update_topics_to_sticky_topics(self, forum, user):
        
        return (
            self._perform_basic_permission_check(forum, user, 'can_edit_posts') and
            self._perform_basic_permission_check(forum, user, 'can_post_stickies')
        )
706029
def _on_group_mute(self, data):
        """"""
        self._groups.get(data.get('id')).update_mute(data)
643858
@Action(semantics = SemanticsOf.SAFE)
    @CollectionLayout(render = RenderType.EAGERLY)
    @ActionLayout(contributed = Contributed.AS_ASSOCIATION)
    public SortedSet<CommunicationChannel> communicationChannels(final CommunicationChannelOwner owner) {
        return communicationChannelRepository.findByOwner(owner);
    }
242175
def promoteChatMember(self, chat_id, user_id,
                          can_change_info=None,
                          can_post_messages=None,
                          can_edit_messages=None,
                          can_delete_messages=None,
                          can_invite_users=None,
                          can_restrict_members=None,
                          can_pin_messages=None,
                          can_promote_members=None):
        
        p = _strip(locals())
        return self._api_request('promoteChatMember', _rectify(p))
627526
public boolean isInvite() {
    if (message == null) {
      return false;
    }

    return (((Request) message).getMethod().equals(Request.INVITE));
  }
185151
def on_welcome(self, connection, event):
        
        connection.join(self.channel, key=settings.IRC_CHANNEL_KEY or "")