Return whether or not `user` can view information about the user.
5101
def can_view(self, user):
        """"""
        return user.is_admin or self == user \
            or set(self.classes).intersection(user.admin_for)
696678
function checkAccessRights(req, res, next) {
	const uri = (typeof req.contextPath === "string" && req.baseUrl.substring(req.contextPath.length)) || req.baseUrl;
	req.user.checkRights(req.user.username, uri, req, res, next);
}
452319
def can_edit(self, user):
        """"""
        return user.is_admin or not self.is_locked and self in user.admin_for
1124675
def check_read_permission(self, user_id, do_raise=True):
        
        return self.network.check_read_permission(user_id, do_raise=do_raise)
716741
protected function canAccess()
    {
        if ($this->formRequest->user()->isAdmin() || $this->formRequest->user()->isUser()) {
            return true;
        }

        return $this->formRequest->user()->canDo('message.message.view');
    }
540980
def has_permission(self, request, view):
        
        user_filter = self._get_user_filter(request)
        if not user_filter:
            # no user filters are present in the token to limit access
            return True

        username_param = get_username_param(request)
        allowed = user_filter == username_param
        if not allowed:
            log.warning(
                u"Permission JwtHasUserFilterForRequestedUser: user_filter %s doesn't match username %s.",
                user_filter,
                username_param,
            )
        return allowed
650244
def has_privs(self, user, lowest_mode='o'):
        """"""
        if isinstance(user, User):
            user = user.nick

        user_prefixes = self.prefixes.get(user, None)

        if not user_prefixes:
            return False

        mode_dict = self.s.features.available['prefix']

        caught = False

        for mode, prefix in mode_dict.items():
            if mode in lowest_mode and not caught:
                caught = True
            elif mode not in lowest_mode and not caught:
                continue

            if prefix in user_prefixes:
                return True

        return False
35187
def has_permission(self, user):
        
        return user.has_perm(
            self.model._meta.app_label + '.' + self.get_permission()
        )
1224869
def check_user(user, password):
    """"""
    return ((user == attowiki.user or attowiki.user is None) and
            (password == attowiki.password or attowiki.password is None))
154606
private function __canAccessAlerts()
    {
        if ($this->Page instanceof AdministrationPage && self::isLoggedIn() && Symphony::Author()->isDeveloper()) {
            return true;
        }

        return false;
    }
1244194
def visible_for?(user)
      can_view_page = (
        if dropdown?
          true
        elsif menuable.kind_of?(Effective::Page)
          menuable.roles_permit?(user)
        else
          true
        end
      )

      can_view_menu_item = (
        if roles_mask == nil
          true
        elsif roles_mask == -1 # Am I logged out?
          user.blank?
        elsif roles_mask == 0 # Am I logged in?
          user.present?
        else
          roles_permit?(user)
        end
      )

      can_view_page && can_view_menu_item
    end
233002
def access(self, user):
        """"""
        if self.denyusers:
            if user in self.denyusers:
                return False
        if self.allowusers:
            if not user in self.allowusers:
                return False
        return True
1039429
def user_has_access(self, user):
        
        if ROLE_ADMIN in user.roles:
            return True

        # Non-admin users should only see active accounts
        if self.enabled:
            if not self.required_roles:
                return True

            for role in self.required_roles:
                if role in user.roles:
                    return True

        return False
785898
def is_accessable_by_others(filename):
    """"""
    mode = os.stat(filename)[stat.ST_MODE]
    return mode & (stat.S_IRWXG | stat.S_IRWXO)
629629
def _check_users(users):

    ''''''

    messg = ''
    valid = True

    for user, user_details in six.iteritems(users):
        if not user_details:
            valid = False
            messg += 'Please provide details for username {user}.\n'.format(user=user)
            continue
        if not (isinstance(user_details.get('level'), int) or 0 <= user_details.get('level') <= 15):
            # warn!
            messg += 'Level must be a integer between 0 and 15 for username {user}. Will assume 0.\n'.format(user=user)

    return valid, messg
831898
private static boolean hasSomeUser() {
        for (User u : User.getAll())
            if(u.getProperty(Details.class)!=null)
                return true;
        return false;
    }
387636
def prj_view_user(self, *args, **kwargs):
        
        if not self.cur_prj:
            return
        i = self.prj_user_tablev.currentIndex()
        item = i.internalPointer()
        if item:
            user = item.internal_data()
            self.view_user(user)