See Changing Permissions for an Application in Sun GlassFish Enterprise Server v3 Application Development Guide.