Package com.serotonin.m2m2.vo.permission

Examples of com.serotonin.m2m2.vo.permission.PermissionException


              reportDao.reportInstanceDataSQL(instanceId, creator);
            else
              reportDao.reportInstanceDataNoSQL(instanceId, creator);
        }
        else if (content == CONTENT_EVENTS)
            new EventCsvStreamer(response.getWriter(), reportDao.getReportInstanceEvents(instanceId), translations);
        else if (content == CONTENT_COMMENTS)
            new UserCommentCsvStreamer(response.getWriter(), reportDao.getReportInstanceUserComments(instanceId),
                    translations);
    }
View Full Code Here


        // Stream the content.
        response.setContentType("text/csv");

        Translations translations = Common.getTranslations();
        if (content == CONTENT_REPORT) {
            ExportCsvStreamer creator = new ExportCsvStreamer(response.getWriter(), translations);
            if(Common.databaseProxy.getNoSQLProxy() == null)
              reportDao.reportInstanceDataSQL(instanceId, creator);
            else
              reportDao.reportInstanceDataNoSQL(instanceId, creator);
        }
View Full Code Here

        data.getState().setAttribute("viewComponentStates", states);
    }

    public static void ensureViewPermission(User user, GraphicalView view) throws PermissionException {
        if (view.getUserAccess(user) == ShareUser.ACCESS_NONE)
            throw new PermissionException("User does not have permission to the view", user);
    }
View Full Code Here

            throw new PermissionException("User does not have permission to the view", user);
    }

    public static void ensureViewEditPermission(User user, GraphicalView view) throws PermissionException {
        if (view.getUserAccess(user) != ShareUser.ACCESS_OWNER)
            throw new PermissionException("User does not have permission to edit the view", user);
    }
View Full Code Here

        return watchListStates;
    }

    public static void ensureWatchListPermission(User user, WatchList watchList) throws PermissionException {
        if (watchList.getUserAccess(user) == ShareUser.ACCESS_NONE)
            throw new PermissionException("User does not have permission to the watch list", user);
    }
View Full Code Here

            throw new PermissionException("User does not have permission to the watch list", user);
    }

    public static void ensureWatchListEditPermission(User user, WatchList watchList) throws PermissionException {
        if (watchList.getUserAccess(user) != ShareUser.ACCESS_OWNER)
            throw new PermissionException("User does not have permission to edit the watch list", user);
    }
View Full Code Here

    @DwrPermission(anonymous = true)
    public String setViewPointAnon(int viewId, String viewComponentId, String valueStr) {
        GraphicalView view = GraphicalViewsCommon.getAnonymousViewDwr(viewId);
        if (view == null)
            throw new PermissionException("View is not in session", null);

        if (view.getAnonymousAccess() != ShareUser.ACCESS_SET)
            throw new PermissionException("Point is not anonymously settable", null);

        // Allow the set.
        setPointImpl(view.findDataPoint(viewComponentId), valueStr, new AnonymousUser());

        return viewComponentId;
View Full Code Here

        if (point != null) {
            // Check that setting is allowed.
            int access = view.getUserAccess(user);
            if (!(access == ShareUser.ACCESS_OWNER || access == ShareUser.ACCESS_SET))
                throw new PermissionException("Not allowed to set this point", user);

            // Try setting the point.
            setPointImpl(point, valueStr, user);
        }
View Full Code Here

        if (user == null)
            throw new RuntimeException("User does not exist");
        if (report == null)
            throw new RuntimeException("Report does not exist");
        if (report.getUserId() != user.getId() && ! user.isAdmin())
            throw new PermissionException("User does not have permission to access the report", user);
    }
View Full Code Here

        if (user == null)
            throw new RuntimeException("User does not exist");
        if (instance == null)
            throw new RuntimeException("Report instance does not exist");
        if (instance.getUserId() != user.getId() && ! user.isAdmin())
            throw new PermissionException("User does not have permission to access the report instance", user);
    }
View Full Code Here

TOP

Related Classes of com.serotonin.m2m2.vo.permission.PermissionException

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.