public static void applyUiPermissions(Frame container){
  Window window=container instanceof Window ? (Window)container : ComponentsHelper.getWindow(container);
  if (window == null) {
    log.warn(String.format("Unable to find window for container %s with id '%s'",container.getClass(),container.getId()));
    return;
  }
  UserSessionSource sessionSource=AppBeans.get(UserSessionSource.NAME);
  UserSession userSession=sessionSource.getUserSession();
  String screenId=window.getId();
  Map<String,Integer> uiPermissions=userSession.getPermissionsByType(PermissionType.UI);
  for (  Map.Entry<String,Integer> permissionEntry : uiPermissions.entrySet()) {
    String target=permissionEntry.getKey();
    String targetComponentId=getTargetComponentId(target,screenId);
    if (targetComponentId != null) {
      if (targetComponentId.contains("[")) {
        applyCompositeComponentPermission(window,screenId,permissionEntry.getValue(),targetComponentId);
      }
 else       if (targetComponentId.contains(">")) {
        applyComponentActionPermission(window,screenId,permissionEntry.getValue(),targetComponentId);
      }
 else {
        applyComponentPermission(window,screenId,permissionEntry.getValue(),targetComponentId);
      }
    }
  }
}

public static void applyUiPermissions ( Frame container ) { Window window = container instanceof Window ? ( Window ) container : ComponentsHelper . getWindow ( container ) ; if ( window == null ) { log . warn ( String . format ( "Unable to find window for container %s with id '%s'" , container . getClass ( ) , container . getId ( ) ) ) ; return ; } UserSessionSource sessionSource = AppBeans . get ( UserSessionSource . NAME ) ; UserSession userSession = sessionSource . getUserSession ( ) ; String screenId = window . getId ( ) ; Map < String , Integer > uiPermissions = userSession . getPermissionsByType ( PermissionType . UI ) ; for ( Map . Entry < String , Integer > permissionEntry : uiPermissions . entrySet ( ) ) { String target = permissionEntry . getKey ( ) ; String targetComponentId = getTargetComponentId ( target , screenId ) ; if ( targetComponentId != null ) { if ( targetComponentId . contains ( "[" ) ) { applyCompositeComponentPermission ( window , screenId , permissionEntry . getValue ( ) , targetComponentId ) ; } else if ( targetComponentId . contains ( ">" ) ) { applyComponentActionPermission ( window , screenId , permissionEntry . getValue ( ) , targetComponentId ) ; } else { applyComponentPermission ( window , screenId , permissionEntry . getValue ( ) , targetComponentId ) ; } } } }
apply ui permissions to a frame .
