[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-10344?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16462327#comment-16462327
 ] 

ASF GitHub Bot commented on CLOUDSTACK-10344:
---------------------------------------------

rhtyd commented on issue #2511: [CLOUDSTACK-10344] bug when moving ACL rules 
(change order with drag and drop)
URL: https://github.com/apache/cloudstack/pull/2511#issuecomment-386270351
 
 
   @rafaelweingartner I think you're trying to solve the ordering problem. 
Here's another problem to this: if two admins are trying to change the order in 
different browsers/cli.
   
   I think the simplest solution is that every change in the UI (drag/drop) 
should send an update to backend which updates when the old list (provided by 
the api) matches the db, otherwise an error can be shown to the user that the 
list was changed (by someone else). An alternative could be that in the UI, you 
drag+drop to change order and there is an apply button that pops up to apply 
the final order.
   I faced a similar issue for drag+drop to reorder rule permissions of a role, 
I used this to solve it:
   https://github.com/apache/cloudstack/blob/master/ui/scripts/roles.js#L196
   
https://github.com/apache/cloudstack/blob/master/api/src/main/java/org/apache/cloudstack/api/command/admin/acl/UpdateRolePermissionCmd.java#L55
   
   Therefore, yes it can be done via the update API adding a new arg.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Sometimes a bug happens when moving ACL rules (changing their order with drag 
> and drop) 
> ----------------------------------------------------------------------------------------
>
>                 Key: CLOUDSTACK-10344
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10344
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the 
> default.) 
>            Reporter: Rafael Weingärtner
>            Assignee: Rafael Weingärtner
>            Priority: Major
>             Fix For: 4.12
>
>
> An error is happening in certain conditions, such as when you have only 2 ACL 
> rules and you move the last one to the top. There are other conditions, for 
> instance, when moving ACLs that are in a sequence of numbers without gaps.
> Example, rules:
> number | rule
> 1 - rule A
> 2 - rule D
> 3 - rule B
> 4 - rule C
> 5 - rule E
> It is not possible to move "rule C" in position 2, 1, and 3.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to