public void validateLogin() throws UnauthorizedException { if (user == null) throw new UnauthorizedException("You have not logged in"); }
public void validateLogin() throws UnauthorizedException { if (user == null) throw new UnauthorizedException("You have not logged in"); }
public void validateLogin() throws UnauthorizedException { if (user == null) throw new UnauthorizedException("You have not logged in"); }
private void checkPermissionOnResourceChain(Permission perm, IResource resource) { for (IResource r : Resources.chain(resource)) if (authorize(r).contains(perm)) return; throw new UnauthorizedException(String.format("User %s has no %s permission on %s or any of its parents", user.getName(), perm, resource)); }
public void ensureNotAnonymous() throws UnauthorizedException { validateLogin(); if (user.isAnonymous()) throw new UnauthorizedException("You have to be logged in and not anonymous to perform this request"); }
private void checkPermissionOnResourceChain(Permission perm, IResource resource) { for (IResource r : Resources.chain(resource)) if (authorize(r).contains(perm)) return; throw new UnauthorizedException(String.format("User %s has no %s permission on %s or any of its parents", user.getName(), perm, resource)); }
public void ensureNotAnonymous() throws UnauthorizedException { validateLogin(); if (user.isAnonymous()) throw new UnauthorizedException("You have to be logged in and not anonymous to perform this request"); }
public void checkAccess(ClientState state) throws UnauthorizedException { if (!state.getUser().isSuper()) throw new UnauthorizedException("Only superusers are allowed to perform DROP USER queries"); }
public void ensureNotAnonymous() throws UnauthorizedException { validateLogin(); if (user.isAnonymous()) throw new UnauthorizedException("You have to be logged in and not anonymous to perform this request"); }
public void checkAccess(ClientState state) throws UnauthorizedException { if (!state.getUser().isSuper()) throw new UnauthorizedException("Only superusers are allowed to perform CREATE USER queries"); }
public void ensureIsSuper(String message) throws UnauthorizedException { if (DatabaseDescriptor.getAuthenticator().requireAuthentication() && (user == null || !user.isSuper())) throw new UnauthorizedException(message); }
public void ensureIsSuper(String message) throws UnauthorizedException { if (DatabaseDescriptor.getAuthenticator().requireAuthentication() && (user == null || !user.isSuper())) throw new UnauthorizedException(message); }
public void ensureIsSuper(String message) throws UnauthorizedException { if (DatabaseDescriptor.getAuthenticator().requireAuthentication() && (user == null || !user.isSuper())) throw new UnauthorizedException(message); }
public void ensureIsSuper(String message) throws UnauthorizedException { if (DatabaseDescriptor.getAuthenticator().requireAuthentication() && (user == null || !user.isSuper())) throw new UnauthorizedException(message); }
public void checkAccess(ClientState state) throws UnauthorizedException { super.checkPermission(state, Permission.CREATE, RoleResource.root()); if (opts.getSuperuser().isPresent()) { if (opts.getSuperuser().get() && !state.getUser().isSuper()) throw new UnauthorizedException("Only superusers can create a role with superuser status"); } }
public void checkAccess(ClientState state) throws UnauthorizedException { super.checkPermission(state, Permission.CREATE, RoleResource.root()); if (opts.getSuperuser().isPresent()) { if (opts.getSuperuser().get() && !state.getUser().isSuper()) throw new UnauthorizedException("Only superusers can create a role with superuser status"); } }
public void checkAccess(ClientState state) throws UnauthorizedException { super.checkPermission(state, Permission.DROP, role); // We only check superuser status for existing roles to avoid // caching info about roles which don't exist (CASSANDRA-9189) if (DatabaseDescriptor.getRoleManager().isExistingRole(role) && Roles.hasSuperuserStatus(role) && !state.getUser().isSuper()) throw new UnauthorizedException("Only superusers can drop a role with superuser status"); }
public void checkAccess(ClientState state) throws UnauthorizedException { super.checkPermission(state, Permission.DROP, role); // We only check superuser status for existing roles to avoid // caching info about roles which don't exist (CASSANDRA-9189) if (DatabaseDescriptor.getRoleManager().isExistingRole(role) && Roles.hasSuperuserStatus(role) && !state.getUser().isSuper()) throw new UnauthorizedException("Only superusers can drop a role with superuser status"); }
public void checkAccess(ClientState state) throws UnauthorizedException { super.checkPermission(state, Permission.DROP, role); // We only check superuser status for existing roles to avoid // caching info about roles which don't exist (CASSANDRA-9189) if (DatabaseDescriptor.getRoleManager().isExistingRole(role) && Roles.hasSuperuserStatus(role) && !state.getUser().isSuper()) throw new UnauthorizedException("Only superusers can drop a role with superuser status"); }
public void checkAccess(ClientState state) throws UnauthorizedException { super.checkPermission(state, Permission.CREATE, RoleResource.root()); if (opts.getSuperuser().isPresent()) { if (opts.getSuperuser().get() && !state.getUser().isSuper()) throw new UnauthorizedException("Only superusers can create a role with superuser status"); } }