Package org.apache.slide.common

Examples of org.apache.slide.common.SlideToken


                                        String subject,
                                        String action) throws Exception {

        String uri = getUriFromPath(nat,path);
       
        SlideToken slideToken = new SlideTokenImpl(new CredentialsToken(caller));
        Security security = nat.getSecurityHelper();
       
        try {
            NodePermission permission = new NodePermission(uri,subject,action);
            nat.begin();
View Full Code Here


                                     String inheritable,
                                     String negative) throws Exception {
                                        
        String uri = getUriFromPath(nat,path);
       
        SlideToken slideToken = new SlideTokenImpl(new CredentialsToken(caller));
        Security security = nat.getSecurityHelper();
       
        boolean isInheritable  = Boolean.valueOf(inheritable).booleanValue();
        boolean isNegative     = Boolean.valueOf(negative).booleanValue();
       
View Full Code Here

    public static void removeLock(NamespaceAccessToken nat,
                                  String caller,
                                  String uri,
                                  String lockId) throws Exception {
       
        SlideToken slideToken = new SlideTokenImpl(new CredentialsToken(caller));
        Lock lock = nat.getLockHelper();
       
        try {
            nat.begin();
            lock.unlock(slideToken,uri,lockId);
View Full Code Here

       boolean isExclusive = Boolean.valueOf(exclusive).booleanValue();
       boolean isInherit = Boolean.valueOf(inherit).booleanValue();
       // expires after one minute
       Date expire = new Date(System.currentTimeMillis() + 1000*60);
      
       SlideToken slideToken = new SlideTokenImpl(new CredentialsToken(caller));
       Lock lock = nat.getLockHelper();
      
       try {
           nat.begin();
           lock.lock(slideToken,new NodeLock(uri,subject,type,expire,isExclusive,isInherit));
View Full Code Here

            // share username and password with other LoginModules
            m_sharedState.put("javax.security.auth.login.name",username);
            m_sharedState.put("javax.security.auth.login.password",password);
           
            // use the user's own credentials to retrieve its info
            SlideToken slideToken = new SlideTokenImpl(new CredentialsToken(username));
           
            // retrieve user object
            SubjectNode userNode;
            try {
                userNode = (SubjectNode) m_security.getPrincipal(slideToken);
View Full Code Here

        String hTxIdStr = req.getHeader(WebdavConstants.H_TRANSACTION);
        return (hTxIdStr != null);
    }
   
    private boolean isCollection(HttpServletRequest req) {
        SlideToken slideToken = new SlideTokenWrapper(WebdavUtils.getSlideToken(req));
        // necessary as no transaction has been started, yet
        slideToken.setForceStoreEnlistment(false);
        slideToken.setForceSecurity(false);
        slideToken.setForceLock(false);
       
        return WebdavUtils.isCollection(token, slideToken, WebdavUtils.getRelativePath(req, (WebdavServletConfig)getServletConfig()));
    }
View Full Code Here

    /**
     * Return true if the store should also be enlisted for a read operation.
     */
    protected boolean isForceStoreEnlistment(Uri uri) {
       
        SlideToken token = uri.getToken();
       
        if (token == null)
            return false;
       
        return token.isForceStoreEnlistment();
       
    }
View Full Code Here

     * @param role Security role to be checked
     */
    public boolean hasRole(Principal principal, String role) {

        CredentialsToken credToken = new CredentialsToken(principal);
        SlideToken slideToken = new SlideTokenImpl(credToken);
        try {
            return securityHelper.hasRole(slideToken, role);
        } catch (SlideException e) {
            return (false);
        }
View Full Code Here

     */
    protected String getPassword(String username) {
       
        Principal userPrincipal = getPrincipal(username);
        CredentialsToken credToken = new CredentialsToken(userPrincipal);
        SlideToken slideToken = new SlideTokenImpl(credToken);
       
        // Fetch the Slide object representing the user.
        try {
           
            ObjectNode user = securityHelper.getPrincipal(slideToken);
View Full Code Here

     * @exception WebdavException
     */
    protected Element getPropertiesOfObject(String resourceUri)
        throws WebdavException {
       
        SlideToken lightSToken = new SlideTokenWrapper(slideToken);
        lightSToken.setForceLock(false);
       
        // evaluate "Label" header
        if (Configuration.useVersionControl()) {
            try {
                resourceUri = versioningHelper.getLabeledResourceUri(resourceUri, labelHeader);
View Full Code Here

TOP

Related Classes of org.apache.slide.common.SlideToken

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.