Permissions update

Old access level mechanism was not very elegant. This replaces how permissions are handled with a more extensible method of handling permissions. Also provides a method to manually assign someone permissions without worrying about house positions.

Database changes:
- New table `office_permissions`
- New table `user_permissions`
- Will remove `access_level` from `offices`
Yeah, I was only referring to the latter part of the conditional.

On Sat, Sep 20, 2014 at 4:54 PM, Daniel Kong <notifications@github.com>
wrote:

>> @@ -338,16 +332,21 @@ def get_office_info(username):
>>    d_dict_user, q_dict_user = get_user_info(username)
>>    offices = get_office_info(username)
>>  
>> +  # True if user has permission to edit page. UserAdmin can edit anyone's
>> +  # page, otherwise a user can edit their own page.
>> +  editable = session['username'] == username or \
>> +    Permissions.UserAdmin in session['permissions']
> The `session['username'] == username` is only useful when we're dealing with something specific like editing your own profile. The idea was that things that need their own custom methods of handling permissions can handle it themselves, while everything else should just check if the permission is in the user's session.
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/RuddockHouse/RuddockWebsite/pull/53/files#r17822386