Package org.eurekastreams.commons.exceptions

Examples of org.eurekastreams.commons.exceptions.AuthorizationException


        Tab tab = tabMapper.findTabByGadgetId(gadgetId);

        // This will throw AuthorizationException if user doesn't have permissions.
        if (!tabPermission.canModifyGadgets(inActionContext.getPrincipal().getAccountId(), tab.getId(), true))
        {
            throw new AuthorizationException("Failed to authorize deleting of the supplied gadget.");
        }
    }
View Full Code Here


    {
        Map<String, Serializable> inFields = (Map<String, Serializable>) inActionContext.getParams();
        //TODO:This should go in a validation strategy.
        if (!inFields.containsKey(accountIdFieldKey))
        {
            throw new AuthorizationException("Account key does not exist, failed to authorize.");
        }

        if (inActionContext.getPrincipal().getAccountId()
                .compareToIgnoreCase((String) inFields.get(accountIdFieldKey)) != 0)
        {
            throw new AuthorizationException("Insufficient permissions to update personal profile.");
        }
    }
View Full Code Here

            }
        }
        catch (Exception ex)
        {
            logger.info("Authorization to change tab layout failed for this request");
            throw new AuthorizationException("Authorization to change tab layout failed for this request", ex);
        }
    }
View Full Code Here

        String consumerKey = (String) inActionContext.getParams();
        Long gadgetCount = verifyMapper.execute(new GetGadgetsByGadgetDefAndConsumerKeyRequest(consumerKey,
                inActionContext.getPrincipal().getId()));
        if (gadgetCount <= 0)
        {
            throw new AuthorizationException("The user supplied with this OAuth request does not have the app "
                    + "associated with this consumer key installed on their start page.");
        }
    }
View Full Code Here

    public void authorize(final PrincipalActionContext inActionContext)
    {
        if (!tabPermission.canRenameTab(inActionContext.getPrincipal().getAccountId(),
                ((RenameTabRequest) inActionContext.getParams()).getTabId(), false))
        {
            throw new AuthorizationException("Insufficient permissions to rename tab.");
        }
    }
View Full Code Here

                {
                    return;
                }
            }

            throw new AuthorizationException("Only a coordinator or follower can get the list of followers "
                    + "of a private group");
        }
    }
View Full Code Here

     *         AuthorizationException (depending on throwException param) otherwise.
     */
    public boolean canDeleteStartPageTab(final String inAccountId, final Long inTabId, final boolean throwException)
    {

        AuthorizationException exception = throwException ? new AuthorizationException(
                "Insufficient permissions to delete tab.") : null;
        return isCurrentUserStartTab(inAccountId, inTabId, exception);
    }
View Full Code Here

     * @return If the tab id represents a tab on the user's start page, true is returned, false or
     *         AuthorizationException (depending on throwException param) otherwise.
     */
    public boolean canChangeTabLayout(final String inAccountId, final Long inTabId, final boolean throwException)
    {
        AuthorizationException exception = throwException ? new AuthorizationException(
                "Insufficient permissions to change tab layout.") : null;
        return isCurrentUserStartTab(inAccountId, inTabId, exception);
    }
View Full Code Here

     * @return If the tab id represents a tab on the user's start page, true is returned, false or
     *         AuthorizationException (depending on throwException param) otherwise.
     */
    public boolean canModifyGadgets(final String inAccountId, final Long inTabId, final boolean throwException)
    {
        AuthorizationException exception = throwException ? new AuthorizationException(
                "Insufficient permissions to modify gadgets on tab.") : null;
        return isCurrentUserStartTab(inAccountId, inTabId, exception);
    }
View Full Code Here

     * @return If the tab id represents a tab on the user's start page, true is returned, false or
     *         AuthorizationException (depending on throwException param) otherwise.
     */
    public boolean canRenameTab(final String inAccountId, final Long inTabId, final boolean throwException)
    {
        AuthorizationException exception = throwException ? new AuthorizationException(
                "Insufficient permissions to rename tab.") : null;
        return isCurrentUserStartTab(inAccountId, inTabId, exception);
    }
View Full Code Here

TOP

Related Classes of org.eurekastreams.commons.exceptions.AuthorizationException

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.