Package org.lealone.dbobject

Examples of org.lealone.dbobject.Right


    }

    private void grantRight() {
        Database db = session.getDatabase();
        for (Table table : tables) {
            Right right = grantee.getRightForTable(table);
            if (right == null) {
                int id = getObjectId();
                right = new Right(db, id, grantee, rightMask, table);
                grantee.grantRight(table, right);
                db.addDatabaseObject(session, right);
            } else {
                right.setRightMask(right.getRightMask() | rightMask);
            }
        }
    }
View Full Code Here


                throw DbException.get(ErrorCode.ROLE_ALREADY_GRANTED_1, grantedRole.getSQL());
            }
        }
        Database db = session.getDatabase();
        int id = getObjectId();
        Right right = new Right(db, id, grantee, grantedRole);
        db.addDatabaseObject(session, right);
        grantee.grantRole(grantedRole, right);
    }
View Full Code Here

        grantee.grantRole(grantedRole, right);
    }

    private void revokeRight() {
        for (Table table : tables) {
            Right right = grantee.getRightForTable(table);
            if (right == null) {
                continue;
            }
            int mask = right.getRightMask();
            int newRight = mask & ~rightMask;
            Database db = session.getDatabase();
            if (newRight == 0) {
                db.removeDatabaseObject(session, right);
            } else {
                right.setRightMask(newRight);
                db.update(session, right);
            }
        }
    }
View Full Code Here

            }
        }
    }

    private void revokeRole(Role grantedRole) {
        Right right = grantee.getRightForRole(grantedRole);
        if (right == null) {
            return;
        }
        Database db = session.getDatabase();
        db.removeDatabaseObject(session, right);
View Full Code Here

TOP

Related Classes of org.lealone.dbobject.Right

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.