@Override public Caller getCaller(Caller currentCaller, SecurityIdentity securityIdentity) { // This is deliberately checking the Subject is the exact same instance. if (currentCaller == null || securityIdentity != currentCaller.getSecurityIdentity()) { return Caller.createCaller(securityIdentity); } return currentCaller; }
public static Caller createCaller(final SecurityIdentity securityIdentity) { checkPermission(ControllerPermission.CREATE_CALLER); return new Caller(securityIdentity); }
/** * This method returns the set of roles already associated with the caller. * * Note: This is the realm mapping of roles and does not automatically mean that these roles will be used for management * access control decisions. * * @return The {@link Set} of associated roles or an empty set if none. */ public Set<String> getAssociatedRoles() { return getAssociatedGroups(); }
boolean save(){ Caller caller = new Caller(); caller = setCommonProperties(caller); caller.setCallerPropertyA(...); caller.setCallerPropertyB(...); ... //save caller return true or false; }
function Caller() { this.makeCall = function () { /*come code here*/ } this.init = function () { this.makeCall(); }; } var a = new Caller(); a.init();
private String getAccountName(final Caller caller, final String currentValue) { return currentValue != null ? currentValue : caller.getName(); }
@Override public Caller getCaller(AccessControlContext acc, Caller currentCaller) { Subject subject = Subject.getSubject(acc); // This is deliberately checking the Subject is the exact same instance. if (currentCaller == null || subject != currentCaller.getSubject()) { if (subject != null) { subject.setReadOnly(); } return Caller.createCaller(subject); } return currentCaller; }
@Override public Caller createCaller(SecurityIdentity securityIdentity) { return Caller.createCaller(securityIdentity); }
} else if (caller.hasSecurityIdentity()) { Map<String, AuthorizerConfiguration.RoleMapping> rolesToCheck; if (authorizerConfiguration.isMapUsingIdentityRoles()) { rolesToCheck = new HashMap<String, AuthorizerConfiguration.RoleMapping>(authorizerConfiguration.getRoleMappings()); SecurityIdentity securityIdentity = caller.getSecurityIdentity(); for (String r : securityIdentity.getRoles()) { String roleName = r.toUpperCase(Locale.ENGLISH); ACCESS_LOGGER .tracef("User '%s' assigned role '%s' due to realm assignment and no exclusion in role mapping definition.", caller.getName(), roleName); ACCESS_LOGGER .tracef("User '%s' NOT assigned role '%s' despite realm assignment due to exclusion match against %s.", caller.getName(), roleName, exclusion); ACCESS_LOGGER .tracef("User '%s' assigned role '%s' due to realm assignment and no role mapping to check for exclusion.", caller.getName(), roleName); if (traceEnabled) { if (includeAll) { ACCESS_LOGGER.tracef("User '%s' assiged role '%s' due to include-all set on role.", caller.getName(), current.getName()); } else { ACCESS_LOGGER.tracef("User '%s' assiged role '%s' due to match on inclusion %s", caller.getName(), current.getName(), inclusion); if (traceEnabled) {
/** * Obtain the {@link Subject} used to create this caller. * * This method will always return {@code null} as this is now backed by a {@link SecurityIdentity} this method remains * however for binary compatibility. * * @return The {@link Subject} used to create this caller. */ public Subject getSubject() { checkPermission(ControllerPermission.GET_CALLER_SUBJECT); return null; }
if (caller.hasSubject()) { Map<String, AuthorizerConfiguration.RoleMapping> rolesToCheck; if (authorizerConfiguration.isMapUsingRealmRoles()) { rolesToCheck = new HashMap<String, AuthorizerConfiguration.RoleMapping>(authorizerConfiguration.getRoleMappings()); Set<String> realmRoles = caller.getAssociatedRoles(); for (String current : realmRoles) { String roleName = current.toUpperCase(); ACCESS_LOGGER .tracef("User '%s' assigned role '%s' due to realm assignment and no exclusion in role mapping definition.", caller.getName(), roleName); ACCESS_LOGGER .tracef("User '%s' NOT assigned role '%s' despite realm assignment due to exclusion match against %s.", caller.getName(), roleName, exclusion); ACCESS_LOGGER .tracef("User '%s' assigned role '%s' due to realm assignment and no role mapping to check for exclusion.", caller.getName(), roleName); if (traceEnabled) { if (includeAll) { ACCESS_LOGGER.tracef("User '%s' assiged role '%s' due to include-all set on role.", caller.getName(), current.getName()); } else { ACCESS_LOGGER.tracef("User '%s' assiged role '%s' due to match on inclusion %s", caller.getName(), current.getName(), inclusion); if (traceEnabled) {
private String getRealmName(final Caller caller, final String currentValue) { return currentValue != null ? currentValue : caller.getRealm(); }
var Caller=(function () { function constructor() { } function makeCall() { /*come code here*/ } constructor.prototype.init=function () { makeCall.apply(this, arguments); }; return constructor; })(); var a=new Caller(); a.init();
private String getAccountName(final Caller caller, final String currentValue) { return currentValue != null ? currentValue : caller.getName(); }
@Override public Caller createCaller(AccessControlContext acc) { Subject subject = Subject.getSubject(acc); return Caller.createCaller(subject); } };
} else if (caller.hasSecurityIdentity()) { Map<String, AuthorizerConfiguration.RoleMapping> rolesToCheck; if (authorizerConfiguration.isMapUsingIdentityRoles()) { rolesToCheck = new HashMap<String, AuthorizerConfiguration.RoleMapping>(authorizerConfiguration.getRoleMappings()); SecurityIdentity securityIdentity = caller.getSecurityIdentity(); for (String r : securityIdentity.getRoles()) { String roleName = r.toUpperCase(Locale.ENGLISH); ACCESS_LOGGER .tracef("User '%s' assigned role '%s' due to realm assignment and no exclusion in role mapping definition.", caller.getName(), roleName); ACCESS_LOGGER .tracef("User '%s' NOT assigned role '%s' despite realm assignment due to exclusion match against %s.", caller.getName(), roleName, exclusion); ACCESS_LOGGER .tracef("User '%s' assigned role '%s' due to realm assignment and no role mapping to check for exclusion.", caller.getName(), roleName); if (traceEnabled) { if (includeAll) { ACCESS_LOGGER.tracef("User '%s' assiged role '%s' due to include-all set on role.", caller.getName(), current.getName()); } else { ACCESS_LOGGER.tracef("User '%s' assiged role '%s' due to match on inclusion %s", caller.getName(), current.getName(), inclusion); if (traceEnabled) {
/** * Obtain the {@link Subject} used to create this caller. * * @return The {@link Subject} used to create this caller. */ public Subject getSubject() { checkPermission(GET_SUBJECT_PERMISSION); return subject; }
private String getRealmName(final Caller caller, final String currentValue) { return currentValue != null ? currentValue : caller.getRealm(); }
public static Caller createCaller(final Subject subject) { checkPermission(CREATE_CALLER_PERMISSION); return new Caller(subject); }
// do some setup in your constructor function Caller(phoneNumber) { this.phoneNumber = phoneNumber; }; Caller.prototype.init = function () { // the code word "this" will be the instance itself this.makeCall(); }; Caller.prototype.makeCall = function () { // do whatever this method needs to do alert('calling ' + this.phoneNumber); }; var a = new Caller(0123456789); a.init();