Stud.IP  5.4
ForumPerm Class Reference

Static Public Member Functions

static has ($perm, $seminar_id, $user_id=null)
 
static check ($perm, $seminar_id, $topic_id=null)
 
static hasEditPerms ($topic_id)
 
static checkCategoryId ($seminar_id, $category_id)
 
static checkTopicId ($seminar_id, $topic_id)
 

Member Function Documentation

◆ check()

static check (   $perm,
  $seminar_id,
  $topic_id = null 
)
static

If the user has not the passed perm in a seminar, an AccessDeniedException is thrown. An optional topic_id can be passed which is checked against the passed seminar if the topic_id belongs to that seminar

Parameters
string$permfor the list of possible perms and their function see ::hasPerm()
string$seminar_idthe seminar to check for
string$topic_idif passed, this topic_id is checked if it belongs to the passed seminar
Exceptions
AccessDeniedException

◆ checkCategoryId()

static checkCategoryId (   $seminar_id,
  $category_id 
)
static

check if the passed category_id belongs to the passed seminar_id. Throws an AccessDenied denied exception if this is not the case

Parameters
string$seminar_idid of the seminar, the category should belong to
string$category_idthe id of the category to check

◆ checkTopicId()

static checkTopicId (   $seminar_id,
  $topic_id 
)
static

check if the passed topic_id belongs to the passed seminar_id. Throws an AccessDenied denied exception if this is not the case

Parameters
string$seminar_idid of the seminar, the category should belong to
string$topic_idthe id of the topic to check

◆ has()

static has (   $perm,
  $seminar_id,
  $user_id = null 
)
static

Check, if the a user has the passed permission in a seminar. Possible permissions are: edit_category - Editing the name of a category
add_category - Adding a new category
remove_category - Removing an existing category
sort_category - Sorting categories
edit_area - Editing an area (title + content)
add_area - Adding a new area
remove_area - Removing an area and all belonging threads
sort_area - Sorting of areas in categories and between categories
search - Searching in postings
edit_entry - Editing of foreign threads/postings
add_entry - Creating a new thread/posting
remove_entry - Removing of foreign threads/postings
fav_entry - Marking a Posting as "favorite"
like_entry - Liking a posting
move_thread - Moving a thrad between ares
close_thread - Close or open a thread
make_sticky - Make a thread sticky
abo - Signing up for mail-notifications for new entries
forward_entry - Forwarding an existing entry as a message
pdfexport - Exporting parts of the forum as PDF
admin - Allowed to mass-administrate the forum
view - Allowed to view the forum at all
edit_closed - Editing entries in a closed thread

Parameters
string$permone of the modular permissions
string$seminar_idthe seminar to check for
string$user_idthe user to check for
Returns
boolean true, if the user has the perms, false otherwise

◆ hasEditPerms()

static hasEditPerms (   $topic_id)
static

Check if the current user is allowed to edit the topic denoted by the passed id

array $perms

Parameters
string$topic_idthe id for the topic to check for
Returns
bool true if the user has the necessary perms, false otherwise

The documentation for this class was generated from the following file: