- Expands the maximum number of admin permission flags you can have from 16 to 31.

To test: add these debug lines somewhere:

//START COPY PASTE

mob/verb/give_allrights()
	src.client.holder.rights = 393087

mob/verb/hasright()
	var/hi = input(src,"Choose a file to access:","Download",null) as null|num
	var/r = check_rights(hi, 1);
	world << "[r]"

mob/verb/checkrights()
	for(var/i = 0; i < 32; i++)
		var/n = 1 << i
		var/r = check_rights(n , 1);
		world << "has right 2^[i] = [n]? [r]"

//END COPY PASTE

Start the game, run 'give allrights', which doesn't give all rights, but some of the rights. 128 and 131072 are missing. Then you can either run 'hasright' to check whether you have the permissions that correspond to a user defined number, or you can run 'checkrights' to check for all 31 theoretical permissions.
This commit is contained in:
errorage
2013-07-22 19:22:47 +02:00
parent 5925d3a876
commit 86a68cb55b
10 changed files with 67 additions and 41 deletions
+4 -4
View File
@@ -77,7 +77,7 @@ datum/preferences
// OOC Metadata:
var/metadata = ""
var/unlock_content = 0
/datum/preferences/New(client/C)
@@ -210,13 +210,13 @@ datum/preferences
dat += "<b>Adminhelp Sound:</b> "
dat += "<a href='?_src_=prefs;preference=hear_adminhelps'>[(toggles & SOUND_ADMINHELP)?"On":"Off"]</a><br>"
if(unlock_content || (user.client.holder && (user.client.holder.rights & R_ADMIN)))
if(unlock_content || check_rights_for(user, R_ADMIN))
dat += "<b>OOC:</b> <span style='border: 1px solid #161616; background-color: [ooccolor];'>&nbsp;&nbsp;&nbsp;</span> <a href='?_src_=prefs;preference=ooccolor;task=input'>Change</a><br>"
if(unlock_content)
dat += "<b>BYOND Membership Publicity:</b> <a href='?_src_=prefs;preference=publicity'>[(toggles & MEMBER_PUBLIC) ? "Public" : "Hidden"]</a><br>"
dat += "<b>Ghost Form:</b> <a href='?_src_=prefs;task=input;preference=ghostform'>[ghost_form]</a><br>"
dat += "</td><td width='300px' height='300px' valign='top'>"