View | Details | Raw Unified | Return to bug 22483
Collapse All | Expand All

(-)a/C4/Auth.pm (-3 / +9 lines)
Lines 2024-2037 sub get_all_subpermissions { Link Here
2024
2024
2025
=head2 haspermission
2025
=head2 haspermission
2026
2026
2027
  $flagsrequired = '*';                                 # Any permission at all
2028
  $flagsrequired = 'a_flag';                            # a_flag must be satisfied (all subpermissions)
2029
  $flagsrequired = [ 'a_flag', 'b_flag' ];              # a_flag OR b_flag must be satisfied
2030
  $flagsrequired = { 'a_flag => 1, 'b_flag' => 1 };     # a_flag AND b_flag must be satisfied
2031
  $flagsrequired = { 'a_flag' => 'sub_a' };             # sub_a of a_flag must be satisfied
2032
  $flagsrequired = { 'a_flag' => [ 'sub_a, 'sub_b' ] }; # sub_a OR sub_b of a_flag must be satisfied
2033
2027
  $flags = ($userid, $flagsrequired);
2034
  $flags = ($userid, $flagsrequired);
2028
2035
2029
C<$userid> the userid of the member
2036
C<$userid> the userid of the member
2030
C<$flags> is a query structure similar to that used by SQL::Abstract that
2037
C<$flags> is a query structure similar to that used by SQL::Abstract that
2031
denotes the combination of flags required.
2038
denotes the combination of flags required. It is a required parameter.
2032
2039
2033
The main logic of this method is that things in arrays are OR'ed, and things
2040
The main logic of this method is that things in arrays are OR'ed, and things
2034
in hashes are AND'ed.
2041
in hashes are AND'ed. The `*` character can be used, at any depth, to denote `ANY`
2035
2042
2036
Returns member's flags or 0 if a permission is not met.
2043
Returns member's flags or 0 if a permission is not met.
2037
2044
2038
- 

Return to bug 22483