You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
2.6 KiB

/* */ package com.archive.common.utils.security;
/* */
/* */ import com.archive.common.utils.MessageUtils;
/* */ import org.apache.commons.lang3.StringUtils;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class PermissionUtils
/* */ {
/* */ public static final String VIEW_PERMISSION = "no.view.permission";
/* */ public static final String CREATE_PERMISSION = "no.create.permission";
/* */ public static final String UPDATE_PERMISSION = "no.update.permission";
/* */ public static final String DELETE_PERMISSION = "no.delete.permission";
/* */ public static final String EXPORT_PERMISSION = "no.export.permission";
/* */ public static final String PERMISSION = "no.permission";
/* */
/* */ public static String getMsg(String permissionsStr) {
/* 52 */ String permission = StringUtils.substringBetween(permissionsStr, "[", "]");
/* 53 */ String msg = MessageUtils.message("no.permission", new Object[] { permission });
/* 54 */ if (StringUtils.endsWithIgnoreCase(permission, "add")) {
/* */
/* 56 */ msg = MessageUtils.message("no.create.permission", new Object[] { permission });
/* */ }
/* 58 */ else if (StringUtils.endsWithIgnoreCase(permission, "edit")) {
/* */
/* 60 */ msg = MessageUtils.message("no.update.permission", new Object[] { permission });
/* */ }
/* 62 */ else if (StringUtils.endsWithIgnoreCase(permission, "remove")) {
/* */
/* 64 */ msg = MessageUtils.message("no.delete.permission", new Object[] { permission });
/* */ }
/* 66 */ else if (StringUtils.endsWithIgnoreCase(permission, "export")) {
/* */
/* 68 */ msg = MessageUtils.message("no.export.permission", new Object[] { permission });
/* */ }
/* 70 */ else if (StringUtils.endsWithAny(permission, (CharSequence[])new String[] { "view", "list" })) {
/* */
/* */
/* 73 */ msg = MessageUtils.message("no.view.permission", new Object[] { permission });
/* */ }
/* 75 */ return msg;
/* */ }
/* */ }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\commo\\utils\security\PermissionUtils.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 1.1.3
*/