On Apr 24, 2012, at 10:56 AM, Marek Posolda wrote:
> 
> 3) Another potentially missing thing is pagination. I assume that we can have 
> thousands of users in DB and thousands of resource objects, which in next 
> turn means that you can have millions of permissions. In large environments, 
> invoking of PermissionManager.listPermissions(Object resource, String 
> operation) could return like 10.000 records. So counting with this case and 
> provide additional methods for pagination support may be good IMO. Something 
> like:
> 
> List<Permission> listPermissions(Object resource, Identity String operation, 
> int offset, int pageSize);
> 

For pagination I propose using something like Range object

https://github.com/bdaw/DeltaSpikeMirror/blob/fc7752409f289b6dfbd577292b70a786a4fb62f4/deltaspike/modules/security/api/src/main/java/org/apache/deltaspike/security/api/idm/Range.java

List<Permission> listPermissions(Object resource, Identity String operation, 
Range range);

with usage like:

listPermissions(customerRecord, READ, Range.of(10,20));

or 

Range page = new Range(0, 10);
x.listPermissions(customerRecord, READ, page.next());

Bolek 



Reply via email to