Package com.baasbox.dao.exception

Examples of com.baasbox.dao.exception.InvalidPermissionTagException


    public ODocument createReserved(String name,boolean enabled) throws Throwable {
        if (Logger.isTraceEnabled()) Logger.trace("Method Start");
        try {
            if (existsPermissionTag(name)) throw new PermissionTagAlreadyExistsException("name> "+name);
        } catch (SqlInjectionException e){
            throw new InvalidPermissionTagException(e);
        }
        ODocument document = new ODocument(MODEL_NAME);
        document.field(TAG,name);
        document.field(ENABLED,enabled);
        document.save();
View Full Code Here


     * @throws com.baasbox.dao.exception.InvalidPermissionTagException
     */
    public boolean setEnabled(String tagName,boolean enabled) throws SqlInjectionException, InvalidPermissionTagException {
        if (Logger.isTraceEnabled()) Logger.trace("Method Start");
        ODocument doc = getByName(tagName);
        if (doc == null) throw new InvalidPermissionTagException("tag does not exists");
        boolean oldValue=doc.<Boolean>field(ENABLED);
        boolean changed = false;
        if (enabled!=oldValue){
            doc.field(ENABLED,enabled);
            doc.save();
View Full Code Here

     * @throws com.baasbox.dao.exception.InvalidPermissionTagException
     */
    public boolean isEnabled(String tagName) throws SqlInjectionException, InvalidPermissionTagException {
        if (Logger.isTraceEnabled()) Logger.trace("Method Start");
        ODocument doc = getByName(tagName);
        if (doc==null) throw new InvalidPermissionTagException("tag not found");
        boolean enabled = doc.<Boolean>field(ENABLED);
        if (Logger.isTraceEnabled()) Logger.trace("Method End");
        return enabled;
    }
View Full Code Here

    }


    private void verifyUnreserved(String name) throws InvalidPermissionTagException {
        if (name.startsWith("baasbox.")){
            throw new InvalidPermissionTagException("baasbox.* permissions are reserved");
        }
    }
View Full Code Here

TOP

Related Classes of com.baasbox.dao.exception.InvalidPermissionTagException

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.