Conditional Statements in Spring @preauthorize EL

Hi here my problem is to add conditional statements in @preauthorize spring annotation ,I need to give Users_view and Users_manage permission for principal but i cant add both permission like below @PreAuthorize("hasPermission(#id, 'com.foo', 'USERS_VIEW','USERS_MANAGE')") in @preauthorize ,I have an idea like below

@PreAuthorize("hasPermission(#id, 'com.foo', 'USERS_VIEW') OR hasPermission(#id, 'com.foo', 'USERS_VIEW')")

Will spring support conditional clauses in @preauthorize so if not what is the solution for this.(Here I need to use only @preauthorize rather than hasroles[])

Thanks in advance

Answers


Of course it will. But I have not tried in uppercase, in lowercase it is sure (I mean or instead of OR). See Logical operators section of the official documentation.


Need Your Help

Mplayer: Thumbnails every second

linux video ffmpeg thumbnails mplayer

I want to create thumbnails every second from a video, but for some reason mplayer skips frames.

How to change the number of partitions using coalesce?

java apache-spark cassandra-2.0

I'm using spark with java and Cassandra data base, and in my program i've used mapPartitions to request cassadra. But i've noticed that my mapPartitions is executed in only one spark node. In order...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.