Package org.dspace.authorize

Examples of org.dspace.authorize.AuthorizeException


        }
        OrganizationUnit grant = getApplicationService().get(OrganizationUnit.class, id);
        Context context = UIUtil.obtainContext(request);
        if (!AuthorizeManager.isAdmin(context))
        {
            throw new AuthorizeException("Only system admin can edit");
        }
        else
        {
            isAdmin = true;
        }

        Integer areaId;
        if (paramTabId == null)
        {
            if (paramFuzzyTabId == null)
            {
                List<EditTabOrganizationUnit> tabs = getApplicationService()
                        .getTabsByVisibility(EditTabOrganizationUnit.class, isAdmin);
                if (tabs.isEmpty())
                {
                    throw new AuthorizeException("No tabs defined!!");
                }
                areaId = tabs.get(0).getId();
            }
            else
            {
View Full Code Here


        // check if request tab from view is active (check on collection before)
        EditTabDynamicObject editT = getApplicationService().get(
                EditTabDynamicObject.class, anagraficaObjectDTO.getTabId());
        if (!tabs.contains(editT))
        {
            throw new AuthorizeException(
                    "You not have needed authorization level to display this tab");
        }

        // collection of boxs
        List<BoxDynamicObject> propertyHolders = new LinkedList<BoxDynamicObject>();
View Full Code Here

        ResearchObject entity = getApplicationService().get(ResearchObject.class,
                id);
        Context context = UIUtil.obtainContext(request);
        if (!AuthorizeManager.isAdmin(context))
        {
            throw new AuthorizeException("Only system admin can edit");
        }
        else
        {
            isAdmin = true;
        }

        Integer areaId;
        if (paramTabId == null)
        {
            if (paramFuzzyTabId == null)
            {
                List<EditTabDynamicObject> tabs = getApplicationService()
                        .<BoxDynamicObject, DynamicObjectType, DynamicPropertiesDefinition, TabDynamicObject, EditTabDynamicObject>getEditTabsByVisibilityAndType(EditTabDynamicObject.class,
                                isAdmin, entity.getTypo());
                if (tabs.isEmpty())
                {
                    throw new AuthorizeException("No tabs defined!!");
                }
                areaId = tabs.get(0).getId();
            }
            else
            {
View Full Code Here

                JSPManager
                        .showAuthorizeError(
                                request,
                                response,
                                new AuthorizeException(
                                        "Only system administrator can access to disabled researcher page"));
            }
            return null;
        }
View Full Code Here

    protected void sendRedirect(HttpServletRequest request,
            HttpServletResponse response, Exception ex, String objectId)
            throws IOException, ServletException
    {
        JSPManager.showAuthorizeError(request, response,
                new AuthorizeException(ex.getMessage()));
        // response.sendRedirect("/cris/rp/" + objectId);
    }
View Full Code Here

            throws Exception
    {
        Context context = UIUtil.obtainContext(request);
        if (!AuthorizeManager.isAdmin(context))
        {
            throw new AuthorizeException(
                    "Only system administrator can access to the functionality");
        }
       
        User userws = (User) super.formBackingObject(request);
        String id = request.getParameter("id");
View Full Code Here

                JSPManager
                        .showAuthorizeError(
                                request,
                                response,
                                new AuthorizeException(
                                        "Only system administrator can access to disabled researcher page"));
            }
            return null;
        }
View Full Code Here

            HttpServletResponse response, Exception ex, String objectId)
            throws IOException, ServletException
    {
        // response.sendRedirect("/cris/project/details?id=" + objectId);
        JSPManager.showAuthorizeError(request, response,
                new AuthorizeException(ex.getMessage()));
    }
View Full Code Here

        // check if request tab from view is active (check on collection before)
        EditTabProject editT = getApplicationService().get(
                EditTabProject.class, anagraficaObjectDTO.getTabId());
        if (!tabs.contains(editT))
        {
            throw new AuthorizeException(
                    "You not have needed authorization level to display this tab");
        }

        // collection of boxs
        List<BoxProject> propertyHolders = new LinkedList<BoxProject>();
View Full Code Here

        }
        Project grant = getApplicationService().get(Project.class, id);
        Context context = UIUtil.obtainContext(request);
        if (!AuthorizeManager.isAdmin(context))
        {
            throw new AuthorizeException("Only system admin can edit");
        }
        else
        {
            isAdmin = true;
        }

        Integer areaId;
        if (paramTabId == null)
        {
            if (paramFuzzyTabId == null)
            {
                List<EditTabProject> tabs = getApplicationService()
                        .getTabsByVisibility(EditTabProject.class, isAdmin);
                if (tabs.isEmpty())
                {
                    throw new AuthorizeException("No tabs defined!!");
                }
                areaId = tabs.get(0).getId();
            }
            else
            {
View Full Code Here

TOP

Related Classes of org.dspace.authorize.AuthorizeException

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.