Search in sources :

Example 1 with AnonymousUser

use of com.serotonin.m2m2.vo.AnonymousUser in project ma-modules-public by infiniteautomation.

the class GraphicalViewDwr method setViewPointAnon.

@DwrPermission(anonymous = true)
public String setViewPointAnon(int viewId, String viewComponentId, String valueStr) {
    GraphicalView view = GraphicalViewsCommon.getAnonymousViewDwr(viewId);
    if (view == null)
        throw new PermissionException(new TranslatableMessage("common.default", "View is not in session"), null);
    if (view.getAnonymousAccess() != ShareUser.ACCESS_SET)
        throw new PermissionException(new TranslatableMessage("common.default", "Point is not anonymously settable"), null);
    // Allow the set.
    setPointImpl(view.findDataPoint(viewComponentId), valueStr, new AnonymousUser());
    return viewComponentId;
}
Also used : PermissionException(com.serotonin.m2m2.vo.permission.PermissionException) AnonymousUser(com.serotonin.m2m2.vo.AnonymousUser) TranslatableMessage(com.serotonin.m2m2.i18n.TranslatableMessage) DwrPermission(com.serotonin.m2m2.web.dwr.util.DwrPermission)

Aggregations

TranslatableMessage (com.serotonin.m2m2.i18n.TranslatableMessage)1 AnonymousUser (com.serotonin.m2m2.vo.AnonymousUser)1 PermissionException (com.serotonin.m2m2.vo.permission.PermissionException)1 DwrPermission (com.serotonin.m2m2.web.dwr.util.DwrPermission)1