MT::Permission - Movable Type permissions record
use MT::Permission;
my $perms = MT::Permission->load({ blog_id => $blog->id,
author_id => $author->id })
or die "Author has no permissions for blog";
$perms->can_post
or die "Author cannot post to blog";
$perms->can_edit_config(0);
$perms->save
or die $perms->errstr;
An MT::Permission object represents the permissions settings for an author in a particular blog. Permissions are set on a role basis, and each permission is either on or off for an author-blog combination; permissions are stored as a bitmask.
As a subclass of MT::Object, MT::Permission inherits all of the data-management and -storage methods from that class; thus you should look at the MT::Object documentation for details about creating a new object, loading an existing object, saving an object, etc.
The following methods are unique to the MT::Permission interface. Each of these methods, except for set_full_permissions, can be called with an optional argument to turn the permission on or off. If the argument is some true value, the permission is enabled; otherwise, the permission is disabled. If no argument is provided at all, the existing permission setting is returned.
Turns on all permissions for the author and blog represented by $perms.
Returns true if the author can post to the blog, and edit the entries that he/she has posted; false otherwise.
Returns true if the author can upload files to the blog directories specified for this blog, false otherwise.
Returns true if the author can edit all entries posted to this blog (even entries that he/she did not write), false otherwise.
Returns true if the author can edit the blog's templates, false otherwise.
Returns true if the author can send messages to the notification list, false otherwise.
Returns true if the author can edit the categories defined for the blog, false otherwise.
Returns true if the author can edit the notification list for the blog, false otherwise.
Returns true if the author can edit author permissions for the blog, and add new authors who have access to the blog; false otherwise.
Note: you should be very careful when giving this permission to authors, because an author could easily then block your access to the blog.
Returns true if the author can edit the blog configuration, false otherwise. Note that this setting also controls whether the author can import entries to the blog, and export entries from the blog.
The MT::Comment object holds the following pieces of data. These fields can be accessed and set using the standard data access methods described in the MT::Object documentation.
In addition to numeric ID lookup, you can look up or sort records by any combination of the following fields. See the load documentation in MT::Object for more information.
Please see the MT manpage for author, copyright, and license information.