1 5 package org.exoplatform.commons.exception; 6 7 import java.util.ResourceBundle ; 8 import org.exoplatform.commons.utils.Formater; 9 10 16 public class ExoPermissionException extends ExoException { 17 private String action_ ; 18 private String requireRole_ ; 19 20 public ExoPermissionException(String action , String requireRole) { 21 action_ = action; 22 requireRole_ = requireRole ; 23 } 24 25 public String getAction() { return action_ ; } 26 27 public String getRequireRole() { return requireRole_ ; } 28 29 public String getExceptionDescription() { 30 return "Usually, this is not a critical exception. The exception is raised " + 31 "when the remote user is not authenticate or he do not have the right " + 32 "to access certain resource"; 33 } 34 35 public String getMessage(ResourceBundle res) { 36 Object [] args = {requireRole_ , action_ } ; 37 String s = res.getString("ExoPermissionException.msg.message") ; 38 return Formater.getDefaultFormater().format(s , args) ; 39 } 40 41 public String getErrorCode() { return "EXO ERROR" ; } 42 } | Popular Tags |