Package io.lumify.core.exception

Examples of io.lumify.core.exception.LumifyAccessDeniedException


    }

    @Override
    public void delete(Workspace workspace, User user) {
        if (!hasWritePermissions(workspace.getWorkspaceId(), user)) {
            throw new LumifyAccessDeniedException("user " + user.getUserId() + " does not have write access to workspace " + workspace.getWorkspaceId(), user, workspace.getWorkspaceId());
        }

        Session session = sessionManager.getSession();
        Transaction transaction = null;
        try {
View Full Code Here


            return null;
        } else if (workspaces.size() > 1) {
            throw new LumifyException("more than one workspace was returned");
        } else {
            if (!hasReadPermissions(workspaceId, user)) {
                throw new LumifyAccessDeniedException("user " + user.getUserId() + " does not have read access to workspace " + workspaceId, user, workspaceId);
            }
            return (SqlWorkspace) workspaces.get(0);
        }
    }
View Full Code Here

    @Override
    public void setTitle(Workspace workspace, String title, User user) {
        Session session = sessionManager.getSession();
        if (!hasWritePermissions(workspace.getWorkspaceId(), user)) {
            throw new LumifyAccessDeniedException("user " + user.getUserId() + " does not have write access to workspace " + workspace.getWorkspaceId(), user, workspace.getWorkspaceId());
        }

        Transaction transaction = null;
        try {
            transaction = session.beginTransaction();
View Full Code Here

    }

    @Override
    public List<WorkspaceEntity> findEntities(Workspace workspace, User user) {
        if (!hasReadPermissions(workspace.getWorkspaceId(), user)) {
            throw new LumifyAccessDeniedException("user " + user.getUserId() + " does not have read access to workspace " + workspace.getWorkspaceId(), user, workspace.getWorkspaceId());
        }

        Session session = sessionManager.getSession();
        SqlWorkspace sqlWorkspace = (SqlWorkspace) session.get(SqlWorkspace.class, workspace.getWorkspaceId());
        List<WorkspaceEntity> workspaceEntities;
View Full Code Here

    @Override
    public void updateEntitiesOnWorkspace(Workspace workspace, Iterable<Update> updates, User user) {
        checkNotNull(workspace, "Workspace cannot be null");

        if (!hasWritePermissions(workspace.getWorkspaceId(), user)) {
            throw new LumifyAccessDeniedException("user " + user.getUserId() + " does not have write access to workspace " + workspace.getWorkspaceId(), user, workspace.getWorkspaceId());
        }

        Session session = sessionManager.getSession();
        Transaction transaction = null;
        try {
View Full Code Here

     */
    @Override
    public void updateUserOnWorkspace(Workspace workspace, String userId, WorkspaceAccess workspaceAccess, User user) {
        checkNotNull(userId);
        if (!hasWritePermissions(workspace.getWorkspaceId(), user)) {
            throw new LumifyAccessDeniedException("user " + user.getUserId() + " does not have write access to workspace " + workspace.getWorkspaceId(), user, workspace.getWorkspaceId());
        }

        SqlUser userToUpdate = (SqlUser) userRepository.findById(userId);

        Session session = sessionManager.getSession();
View Full Code Here

TOP

Related Classes of io.lumify.core.exception.LumifyAccessDeniedException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.