Check if super admin exists
519550
private function checkIfAdminExists(): void
    {
        $adminExists = $this->userService->getRepository()->findOneBy(['email' => $this->email]);

        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;
        }
    }
663222
def admin_required(obj):
    
    decorator = request_passes_test(lambda r, *args, **kwargs: r.user.is_superuser)
    return wrap_object(obj, decorator)
967412
def _is_admin(self, username):
        
        roles = self._get_roles(username)
        return self.roles.is_admin(roles['roles'])
1365427
def admin?
    is_admin = ( ENV['USER'] == 'root' )
    unless is_admin
      ext_admin = exec(:check_admin) do |op, results|
        if op == :reduce
          results.values.include?(true)
        else
          results ? true : false
        end
      end
    end
    is_admin || ext_admin ? true : false
  end
12937
def user_exists(name,
                user=None, host=None, port=None, maintenance_db=None,
                password=None,
                runas=None):
    '''
    
    '''
    return bool(
        role_get(name,
                 user=user,
                 host=host,
                 port=port,
                 maintenance_db=maintenance_db,
                 password=password,
                 runas=runas,
                 return_password=False))
593687
def dir_exists(location, use_sudo=False):
    """"""
    with settings(hide('running', 'stdout', 'stderr'), warn_only=True):
        if use_sudo:
            # convert return code 0 to True
            return not bool(sudo('test -d %s' % (location)).return_code)
        else:
            return not bool(run('test -d %s' % (location)).return_code)
701350
def is_admin(self, user):
        
        return True if self.organization_users.filter(
            user=user, is_admin=True
        ) else False
1278245
def classes_can_admin(self):
        """"""
        if self.is_admin:
            return sorted(Session.query(Class).all())
        else:
            return sorted(self.admin_for)
1234366
public function isUserAdmin()
	{
		$user = $this->getUsersDatabase();
		$sr = $user->getById($this->_context->authenticatedUserId());
		return ($sr->getField($user->getUserTable()->admin) == "yes");
	}
396610
public boolean isSuperAdmin(UserIdentityContext userIdentityContext) {
        //SuperAdmin Account is the one the is
        //1. Has no parent, this is the top account
        //2. Is ACTIVE
        return (userIdentityContext.getEffectiveAccount().getParentSid() == null)
                && (userIdentityContext.getEffectiveAccount().getStatus().equals(Account.Status.ACTIVE));
    }
811008
def superuser_required(view_func=None, redirect_field_name=REDIRECT_FIELD_NAME,
                       login_url='admin:login'):
    
    actual_decorator = user_passes_test(
        lambda u: u.is_active and u.is_superuser,
        login_url=login_url,
        redirect_field_name=redirect_field_name
    )
    if view_func:
        return actual_decorator(view_func)
    return actual_decorator
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
762065
def exists?(vm_name = nil)
      return (vm_names.count > 0) if vm_name.nil?
      vm_names.include? vm_name.to_sym
    end
139499
static boolean isSuperTango()
	{
		//	Check if already done
		if (super_tango==null)
			if ((super_tango=System.getProperty("SUPER_TANGO"))==null)	//	From JVM property
				if ((super_tango=System.getenv("SUPER_TANGO"))==null)		//	From Environment property
					if ((super_tango=getFromEnvFile("SUPER_TANGO"))==null)		//	From Environment file
						super_tango = "false";
		return (super_tango.trim().toLowerCase().equals("true"));
	}
1263092
def require_super_admin
      unless @current_user.super_admin?
        text = "#{I18n.t("authentication.permission_denied.heading")}: #{I18n.t("authentication.permission_denied.message")}"
        set_flash_message(text, :error, false) if defined?(flash) && flash
        redirect_or_popup_to_default_sign_in_page(false)
      end
    end
894940
function isActionsExistsInPermissionActions(allActions, schemaActions) {
    return utils.contains(allActions.sort().join(), schemaActions.sort().join());
}
5101
def can_view(self, user):
        """"""
        return user.is_admin or self == user \
            or set(self.classes).intersection(user.admin_for)