Primary

Groups_File_Access

The Groups_File_Access class provides class methods that can be used to obtain information about files and user access on files.

Groups_File_Access::can_access( $user_id, $file_id )

Returns true if a user can access a file handled by the Groups File Access plugin.

Parameters:

  • int $user_id the user id
  • int $file_id the file id

Returns:

boolean true if the user can access the file, otherwise false

Groups_File_Access:get_count( $user_id, $file_id )

Return the number of times the user has accessed the file.

Parameters:

  • int $user_id the user id
  • int $file_id the file id

Returns:

int number of times

Groups_File_Access:get_max_count( $file_id )

Returns the maximum number of accesses allowed per user for the given file.

Parameters:

  • int $file_id the file id

Returns:

int number of accesses allowed, 0 for unlimited, null on error

Groups_File_Access::get_remaining( $user_id, $file_id )

Returns the number of remaining accesses on the file for the given user.

Parameters:

  • int $user_id the user id
  • int $file_id the file id

Returns:

int remaining number of times the user can access the file or INF if unlimited