1 13 14 package org.ejbca.core.model.authorization; 15 16 22 public class BasicAccessRuleSet implements java.io.Serializable { 23 24 public static final int ROLE_NONE = 0; 25 public static final int ROLE_SUPERADMINISTRATOR = 1; 26 public static final int ROLE_CAADMINISTRATOR = 2; 27 public static final int ROLE_RAADMINISTRATOR = 3; 28 public static final int ROLE_SUPERVISOR = 4; 29 public static final int ROLE_HARDTOKENISSUER = 5; 30 31 public static final int ENDENTITY_VIEW = 2; 32 public static final int ENDENTITY_VIEWHISTORY = 4; 33 public static final int ENDENTITY_VIEWHARDTOKENS = 8; 34 public static final int ENDENTITY_CREATE = 16; 35 public static final int ENDENTITY_EDIT = 32; 36 public static final int ENDENTITY_DELETE = 64; 37 public static final int ENDENTITY_REVOKE = 128; 38 public static final int ENDENTITY_KEYRECOVER = 256; 39 public static final int ENDENTITY_APPROVE = 512; 40 41 public static final int ENDENTITYPROFILE_ALL = 0; 42 43 public static final int CA_ALL = 0; 44 45 public static final int OTHER_VIEWLOG = 1; 46 public static final int OTHER_ISSUEHARDTOKENS = 2; 47 48 public static final String [] ROLETEXTS = {"NONE","SUPERADMINISTRATOR","CAADMINISTRATOR", 49 "RAADMINISTRATOR", "SUPERVISOR", 50 "HARDTOKENISSUER"}; 51 52 public static final String [] ENDENTITYRULETEXTS = {"VIEWENDENTITYRULE","VIEWHISTORYRULE","VIEWHARDTOKENRULE", 53 "CREATEENDENTITYRULE","EDITENDENTITYRULE","DELETEENDENTITYRULE", 54 "REVOKEENDENTITYRULE", "KEYRECOVERENDENTITYRULE", 55 "APPROVEENDENTITYRULE"}; 56 57 public static final String [] OTHERTEXTS = {"","VIEWLOG","ISSUEHARDTOKENS"}; 58 59 62 private BasicAccessRuleSet(){} 63 64 public static String getEndEntityRuleText(int endentityrule){ 65 String returnval = ""; 66 67 switch(endentityrule){ 68 case BasicAccessRuleSet.ENDENTITY_VIEW: 69 returnval = ENDENTITYRULETEXTS[0]; 70 break; 71 case BasicAccessRuleSet.ENDENTITY_VIEWHISTORY: 72 returnval = ENDENTITYRULETEXTS[1]; 73 break; 74 case BasicAccessRuleSet.ENDENTITY_VIEWHARDTOKENS: 75 returnval = ENDENTITYRULETEXTS[2]; 76 break; 77 case BasicAccessRuleSet.ENDENTITY_CREATE: 78 returnval = ENDENTITYRULETEXTS[3]; 79 break; 80 case BasicAccessRuleSet.ENDENTITY_EDIT: 81 returnval = ENDENTITYRULETEXTS[4]; 82 break; 83 case BasicAccessRuleSet.ENDENTITY_DELETE: 84 returnval = ENDENTITYRULETEXTS[5]; 85 break; 86 case BasicAccessRuleSet.ENDENTITY_REVOKE: 87 returnval = ENDENTITYRULETEXTS[6]; 88 break; 89 case BasicAccessRuleSet.ENDENTITY_KEYRECOVER: 90 returnval = ENDENTITYRULETEXTS[7]; 91 break; 92 case BasicAccessRuleSet.ENDENTITY_APPROVE: 93 returnval = ENDENTITYRULETEXTS[8]; 94 break; 95 } 96 return returnval; 97 } 98 99 100 } 101 | Popular Tags |