首页 \ 问答 \ 允许在security.yml中对Symfony对象操作进行不安全的访问(Allow unsecured access to Symfony object action in security.yml)

允许在security.yml中对Symfony对象操作进行不安全的访问(Allow unsecured access to Symfony object action in security.yml)

我在Symfony 1.4.13中有一个特定的模块,默认设置在security.yml文件中。 我有一个特定的对象动作,我希望任何人都可以访问(注销用户),但似乎无法找到正确的方法来在YAML文件中找出动作的名称以获得匹配。

具体来说,我有一个project模块,其中包含典型的索引,显示,创建等操作,以及runReport对象操作(因此操作方法的名称为executeListRunReport )。 security.yml文件如下:

all:
  is_secure: true

index:
  credentials: pm_view

show:
  credentials: pm_view

filter:
  credentials: pm_view

runReport:   # This is the one that is giving me problems
  is_secure: false

actions.php中的方法是:

public function executeListRunReport(sfWebRequest $request) {
...
}

当进入project/[idOfObject]/ListRunReport时,这适用于登录用户。

如何编写security.yml文件以允许任何人访问该操作(例如直接从我手工生成的URL)而无需登录? 谢谢!


I have a particular module in Symfony 1.4.13 that is set to be secured by default in its security.yml file. I have one particular object action that I would like accessible by anyone (logged out users), but can't seem to find the correct way to right out action's name in the YAML file to get a match on it.

Specifically, I have a project module with the typical index, show, create, etc. actions, as well as a runReport object action (so the action method's name is executeListRunReport). The security.yml file is as follows:

all:
  is_secure: true

index:
  credentials: pm_view

show:
  credentials: pm_view

filter:
  credentials: pm_view

runReport:   # This is the one that is giving me problems
  is_secure: false

My method in actions.php is:

public function executeListRunReport(sfWebRequest $request) {
...
}

This works just fine for a logged in user when going to project/[idOfObject]/ListRunReport.

How can I write the security.yml file to allow anyone to access that action (directly from a URL that I generate by hand for example) without having to log in? Thanks!


原文:https://stackoverflow.com/questions/7810210
更新时间:2023-09-12 10:09

最满意答案

由于引入了CUBLAS V2 API(使用CUDA 4.0,IIRC),因此可以使用返回标量或索引的例程将它们直接存储到设备内存中的变量中,而不是存储到主变量中(这需要设备主机传输并可能将结果留在错误的内存空间中)。

要使用它,你需要使用cublasSetPointerMode调用来告诉CUBLAS上下文,期望通过使用CUBLAS_POINTER_MODE_DEVICE模式,标量参数的指针成为设备指针。 这就意味着在这样的通话中

cublasStatus_t cublasIsamax(cublasHandle_t handle, int n,
                            const float *x, int incx, int *result)

result必须是设备指针。


Since the CUBLAS V2 API was introduced (with CUDA 4.0, IIRC), it is possible to have routines which return a scalar or index to store those directly into a variable in device memory, rather than into a host variable (which entails a device to host transfer and might leave the result in the wrong memory space).

To use this, you need to use the cublasSetPointerMode call to tell the CUBLAS context to expect pointers for scalar arguments to be device pointers by using the CUBLAS_POINTER_MODE_DEVICE mode. This then implies that in a call like

cublasStatus_t cublasIsamax(cublasHandle_t handle, int n,
                            const float *x, int incx, int *result)

that result must be a device pointer.

相关问答

更多
  • 如果要实现回退,则可能需要在运行时切换到它。 但是您收到编译器错误消息的事实表明您正在使用不同的标志进行编译。 一般来说,你可能想要这样的东西: if (HasCuda()) { RunCudaCode(...); } else { RunCpuCode(...); } 或者,您可以构建两个共享库,一个和一个没有Cuda,并根据HasCuda()加载您需要的HasCuda() 。 但是,如果您的二进制文件非常庞大并且遇到了内存问题,那么这种方法才有意义。 可能需要在初始化Cuda的启动代码中使用类 ...
  • 有整数的最小/最大设备函数,但它们都被重载的max()调用。 查看device_functions.hpp: __DEVICE_FUNCTIONS_STATIC_DECL__ int max(int x, int y) { return __nv_max(x, y); } __DEVICE_FUNCTIONS_STATIC_DECL__ unsigned int umax(unsigned int x, unsigned int y) { return __nv_umax(x, y); } __ ...
  • 编译器需要M作为编译时常量。 在编译时它无法确定M实际上是什么(它不知道你最终会将它传递给84)。 如果要使用只在运行时知道的大小共享内存,则使用动态共享内存。 请参阅站点上的此示例或在Parallel4All博客上使用CUDA中的共享内存 。 The compiler needs M to be a compile-time constant. At compile time it cannot determine what M is actually going to be (it doesn't kn ...
  • 这里有几个问题。 您需要修改warp和block最小函数,以便在每次找到新的局部最小值时传播最小值及其索引。 也许是这样的: __inline__ __device__ void warpReduceMin(int& val, int& idx) { for (int offset = warpSize / 2; offset > 0; offset /= 2) { int tmpVal = __shfl_down(val, offset); int tmpIdx = ...
  • kernelkernel<<>> 这是一个重要的问题; nVidia GPU上的线程以32个线程的变形工作。 但是,您只为每个块分配了单个线程,这意味着这些线程中的31个将在单个线程工作时处于空闲状态。 通常情况下,对于具有灵活性的内核,通常每块需要多个warp,而不仅仅是一个warp。 您可以通过每个块使用N个块和N个线程立即加速,而不是使用N ^ 2个块。 实际上,N可能太大,因为每块的线程数有上限。 虽然可以选择合适的M,以便每块使用N / M个线程,并使用N * M个块。 实际上 ...
  • 这不是使用动态分配的共享内存的有效方法: T *sdata = SharedMemory(); int *sdataIdx = SharedMemory(); 这两个指针( sdata和sdataIdx )最终将指向同一位置。 ( 文档讨论了如何正确处理这个问题。) 即使您现在想要使用两倍的共享内存(用于存储min plus index),与之前的仅减少代码相比,您还没有增加动态分配大小: int smemSize = (threads <= 32) ? 2 * thre ...
  • 由于引入了CUBLAS V2 API(使用CUDA 4.0,IIRC),因此可以使用返回标量或索引的例程将它们直接存储到设备内存中的变量中,而不是存储到主变量中(这需要设备主机传输并可能将结果留在错误的内存空间中)。 要使用它,你需要使用cublasSetPointerMode调用来告诉CUBLAS上下文,期望通过使用CUBLAS_POINTER_MODE_DEVICE模式,标量参数的指针成为设备指针。 这就意味着在这样的通话中 cublasStatus_t cublasIsamax(cublasHandl ...
  • 您只需添加__host__关键字即可从主机或设备调用函数调用。 __host__ __device__ int sum(int a, int b){ return a+b; } You just have to add the __host__ keyword to be able to call call a function from host or device. __host__ __device__ int sum(int a, int b){ return a+b; }
  • 人们是对的,但我会告诉你继续做下去。 在图像上执行此类操作对于理解CUDA和并行编程是完美的,尽管作为多线程CPU不是很有效。 我的建议使用1-使用单个线程来执行操作并为每个操作计时。 2-然后使用OpenMP在CPU上执行操作(使用2,4和更多线程,具体取决于您拥有的核心数量.3)尝试在Cuda中编程,您将学习很多并行编程基元。过程(并行减少最小值,平均操作) 稍后当你想要更复杂的东西,如直方图,可变形注册或平滑操作时,你将开始欣赏并行编程速度。 提示:读取图像等IO操作在所有程序中都具有相同的代码。 P ...
  • 内核调用在单个流中排队并逐个执行。 但是,您可以在内核执行期间指定流 - 然后可以同时运行不同流中的CUDA操作,并且可以交错来自不同流的操作。 默认流为0。 请参阅: CUDA Streams和Concurrency 当不同的进程使用相同的卡时,情况类似。 还记得内核是从CPU的东西异步执行的。 Kernel calls are queued and executed one by one in single stream. However you can specify stream during ke ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)