Package org.wso2.carbon.registry.core.secure

Examples of org.wso2.carbon.registry.core.secure.AuthorizationFailedException


        if (!AuthorizationUtils.authorize(path, ActionConstants.GET)) {
            String msg = "User " + CurrentSession.getUser() + " is not authorized to " +
                    "check out the path " + path + ".";
            log.warn(msg);
            throw new AuthorizationFailedException(msg);
        }

        xmlWriter.writeStartElement(DumpConstants.RESOURCE);

        // adding path as an attribute, updated dump has name instead of path
View Full Code Here


        } else {
            if (!AuthorizationUtils.authorize(path, ActionConstants.GET)) {
                String msg = "User " + CurrentSession.getUser() + " is not authorized to " +
                        "read the resource " + path + ".";
                log.warn(msg);
                throw new AuthorizationFailedException(msg);
            }
            GhostResource<Resource> ghostResource =
                    (GhostResource<Resource>) cache.get(registryCacheKey);
            resource = ghostResource.getResource();
            if (resource == null) {
View Full Code Here

        } else {
            if (!AuthorizationUtils.authorize(path, ActionConstants.GET)) {
                String msg = "User " + CurrentSession.getUser() + " is not authorized to " +
                        "read the resource " + path + ".";
                log.warn(msg);
                throw new AuthorizationFailedException(msg);
            }
            GhostResource<Resource> ghostResource =
                    (GhostResource<Resource>) cache.get(registryCacheKey);
            collection = (Collection) ghostResource.getResource();
            if (collection == null) {
View Full Code Here

                userName = UserCoreUtil.getTenantLessUsername(userName);
            }
            if (!authenticator.authenticate(userName, password)) {
                String msg = "Attempted to authenticate invalid user.";
                log.warn(msg);
                throw new AuthorizationFailedException(msg);
            }

        } catch (org.wso2.carbon.user.api.UserStoreException e) {
            String msg = "Could not obtain the authenticator for authenticating the user " +
                    userName + ". \nCaused by " + e.getMessage();
View Full Code Here

        if (!AuthorizationUtils.authorize(versionedPath.getPath(), ActionConstants.GET)) {
            String msg = "User " + CurrentSession.getUser() + " is not authorized to " +
                    "read the resource " + versionedPath + ".";
            log.warn(msg);
            throw new AuthorizationFailedException(msg);
        }

        long snapshotID = versionedPath.getVersion();

        ResourceImpl resourceImpl = resourceVersionDAO.get(resourceID, snapshotID);
View Full Code Here

        if (!AuthorizationUtils.authorize(versionedPath.getPath(), ActionConstants.GET)) {
            String msg = "User " + CurrentSession.getUser() + " is not authorized to " +
                    "read the resource " + versionedPath + ".";
            log.warn(msg);
            throw new AuthorizationFailedException(msg);
        }

        long snapshotID = versionedPath.getVersion();

        ResourceImpl resourceImpl = resourceVersionDAO.get(resourceID, snapshotID);
View Full Code Here

        ResourceIDImpl resourceID = resourceDAO.getResourceID(versionedResourcePath);
        if (!AuthorizationUtils.authorize(versionedResourcePath, ActionConstants.PUT)) {
            String msg = "User " + CurrentSession.getUser() + " is not authorized to " +
                    "restore the resource " + versionedResourcePath + ".";
            log.warn(msg);
            throw new AuthorizationFailedException(msg);
        }

        restoreSnapshotNetwork(resourceID, snapshotID);
    }
View Full Code Here

        if (versionRetriever == null) {
            String msg = "The snapshot " + snapshotID + " doesn't contain the " +
                    "resource " + resourceID.getPath();
            log.warn(msg);
            throw new AuthorizationFailedException(msg);
        }
        int versionIndex = 0;
        while (true) {
            long version = versionRetriever.getVersion(versionIndex);
            if (version == -1) {
View Full Code Here

                    String msg = "User: " + userID +
                            " is not authorized to delete the comment on the resource: " +
                            authorizationPath;
                    log.warn(msg);
                    throw new AuthorizationFailedException(msg);
                }

            } catch (UserStoreException e) {
                //
            }
View Full Code Here

                        } else {
                            String msg = "User: " + user +
                                    " is not authorized to delete the comment on the resource: " +
                                    processedPath.getPath();
                            log.warn(msg);
                            throw new AuthorizationFailedException(msg);
                        }
                    }
                }
                if (context.isLoggingActivity()) {
                    if (temp != null) {
View Full Code Here

TOP

Related Classes of org.wso2.carbon.registry.core.secure.AuthorizationFailedException

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.