Check if super admin exists
328491
private function checkIfAdminExists()
    {
        $adminExists = HCUsers::where('email', $this->email)->first();

        if( ! is_null($adminExists) ) {

            $this->checkIfHaveSuperAdminRole($adminExists);

            $this->info('Admin account already exists!');

            if( $this->confirm('Do you want to change its password? [y|N]') ) {
                $this->changePassword($adminExists);
            }

            exit;
        }
    }
10126
public function isAdminActive(AdminInterface $admin, $adminCode = '')
    {
        $active = false;
        if ($adminCode == $admin->getCode()) {
            $active = true;
        }

        if (method_exists($admin, 'getSubNavLinks')) {
            foreach ($admin->getSubNavLinks() as $value) {
                if ($value instanceof AdminInterface) {
                    if ($value->getCode() == $adminCode) {
                        $active = true;
                    }
                }
            }
        }

        return $active;
    }
1178923
def exists(project, credentials):
        """"""
        user, oauth_access_token = parsecredentials(credentials) #pylint: disable=unused-variable
        printdebug("Checking if project " + project + " exists for " + user)
        return os.path.isdir(Project.path(project, user))
1111489
private function maybeAdmin() {
        if ( empty( $this->request ) || strpos( $this->request, 'wp-admin/' ) !== FALSE ) {
            $this->error = NULL;
            if (
                ! is_null( $this->perma_q_vars )
                && strpos( $this->request, 'wp-admin/' ) !== FALSE
            ) {
                $this->perma_q_vars = NULL;
            }
        }
    }
1157871
def has_permission(user, permission_name):
    """"""
    if user and user.is_superuser:
        return True

    return permission_name in available_perm_names(user)
298028
public function isAdmin()
    {
        if (is_null($this->admin)) {
            $this->admin = (bool)is_admin();
        }

        return $this->admin;
    }
517947
def check_exists(name, path):
    '''
    
    '''
    cmd = [_get_cmd(), '--display', name]
    out = __salt__['cmd.run_all'](cmd, python_shell=False)

    if out['retcode'] > 0 and out['stderr'] != '':
        return False

    return any((line.startswith(path) for line in out['stdout'].splitlines()))
1035578
def exists(*nictag, **kwargs):
    '''
    
    '''
    ret = {}
    if not nictag:
        return {'Error': 'Please provide at least one nictag to check.'}

    cmd = 'nictagadm exists -l {0}'.format(' '.join(nictag))
    res = __salt__['cmd.run_all'](cmd)

    if not kwargs.get('verbose', False):
        ret = res['retcode'] == 0
    else:
        missing = res['stderr'].splitlines()
        for nt in nictag:
            ret[nt] = nt not in missing

    return ret
956336
def isRealmUser(self, realmname, username, environ):
        """"""
        try:
            course = self.course_factory.get_course(realmname)
            ok = self.user_manager.has_admin_rights_on_course(course, username=username)
            return ok
        except:
            return False
556209
public boolean isUserAdmin(String userName) {

        if (CmsStringUtil.isEmptyOrWhitespaceOnly(userName)) {
            return false;
        }
        return m_userAdmin.equals(userName);
    }
124147
def is_admin(self):
        """"""
        return self.role == self.roles.administrator.value and self.state == State.approved
1147574
def is_admin(name):
    '''
    
    '''
    groups = get_user_groups(name, True)

    for group in groups:
        if group in ('S-1-5-32-544', 'S-1-5-18'):
            return True

    return False
1261374
def server_exists(s_name, ip=None, s_state=None, **connection_args):
    '''
    
    '''
    server = _server_get(s_name, **connection_args)
    if server is None:
        return False
    if ip is not None and ip != server.get_ipaddress():
        return False
    if s_state is not None and s_state.upper() != server.get_state():
        return False
    return True
894940
function isActionsExistsInPermissionActions(allActions, schemaActions) {
    return utils.contains(allActions.sort().join(), schemaActions.sort().join());
}
578275
public function canAdmin()
    {
        $component = $this->getIdentifier()->package;

        return $this->getObject('user')->authorise('core.admin', 'com_'.$component) === true;
    }
1081799
private void tryToMakeAdmin(User u) {
        AuthorizationStrategy as = Jenkins.getInstance().getAuthorizationStrategy();
        for (PermissionAdder adder : ExtensionList.lookup(PermissionAdder.class)) {
            if (adder.add(as, u, Jenkins.ADMINISTER)) {
                return;
            }
        }
    }
27270
def user_has_super_roles():
    
    member = api.get_current_user()
    super_roles = ["LabManager", "Manager"]
    diff = filter(lambda role: role in super_roles, member.getRoles())
    return len(diff) > 0