1 19 20 package com.sslexplorer.security.itemactions; 21 22 import com.sslexplorer.policyframework.Permission; 23 import com.sslexplorer.policyframework.PolicyConstants; 24 import com.sslexplorer.security.AuthenticationScheme; 25 import com.sslexplorer.security.AuthenticationSchemeSequenceItem; 26 import com.sslexplorer.security.SessionInfo; 27 import com.sslexplorer.table.AvailableTableItemAction; 28 import com.sslexplorer.table.TableItemAction; 29 30 32 public class EnableAuthenticationSchemeAction extends TableItemAction { 33 34 37 public EnableAuthenticationSchemeAction() { 38 super("enable", "security", 300, "", false, SessionInfo.MANAGEMENT_CONSOLE_CONTEXT, 39 PolicyConstants.AUTHENTICATION_SCHEMES_RESOURCE_TYPE, new Permission[] { PolicyConstants.PERM_CREATE_EDIT_AND_ASSIGN, PolicyConstants.PERM_EDIT_AND_ASSIGN }); 40 } 41 42 @Override 43 public String getPath(AvailableTableItemAction availableItem) { 44 AuthenticationSchemeSequenceItem item = (AuthenticationSchemeSequenceItem)availableItem.getRowItem(); 45 return "/showAuthenticationSchemes.do?actionTarget=enable&selectedResource=" + item.getResource().getResourceId(); 46 } 47 48 @Override 49 public boolean isEnabled(AvailableTableItemAction availableItem) { 50 AuthenticationSchemeSequenceItem item = (AuthenticationSchemeSequenceItem)availableItem.getRowItem(); 51 return !((AuthenticationScheme)item.getResource()).getEnabled(); 52 } 53 } 54 | Popular Tags |