1 24 package org.riotfamily.riot.hibernate.security; 25 26 import org.riotfamily.riot.security.auth.RiotUser; 27 import org.riotfamily.riot.security.policy.AuthorizationPolicy; 28 29 public abstract class AbstractRoleBasedPolicy implements AuthorizationPolicy { 30 31 private int order = Integer.MAX_VALUE - 1; 32 33 public int getOrder() { 34 return this.order; 35 } 36 37 public void setOrder(int order) { 38 this.order = order; 39 } 40 41 public final int checkPermission(RiotUser riotUser, String action, 42 Object object) { 43 44 User user = (User) riotUser; 45 return checkRolePermission(user.getRole(), action, object); 46 } 47 48 protected abstract int checkRolePermission(String role, String action, 49 Object object); 50 51 } 52 | Popular Tags |