Hi there.
I have an array of permissions:
array(
array( "controller" => "somewhere", "action" => "", "namespace" => "admin", "method" => "GET" ),
array( "controller" => "somewhere", "action" => "index", "namespace" => "admin", "method" => "" ),
array( "controller" => "somewhere", "action" => "index", "namespace" => "admin", "method" => "GET" )
)
That I need to sort, so that the most "specific" one is listed first. Weather or not it's specific is determined by its relevance to the currently loaded controller, action and namespace.
Firstly: The three arrays' controllers cover the same area, but their actions doesn't. So the ones with a specific action should be sorted above those without.
Secondly: They share the same namespace, but not the same method. So the ones with a specific method should be sorted above those without.
If you have any ideas, or have any questions that needs explenations, please ask me. I would really appreciate being able to sort this array, so I don't have to redo my architecture for the permissions.
// Emil