comprobar permisos con javascript

10/05/2005 - 10:00 por guitar | Informe spam
Hola foreros, queria saber si puedo comprobar si un usuario es administrador
o no con JavaScript ??.
Muchas gracias

Preguntas similare

Leer las respuestas

#6 Zucco
19/09/2006 - 21:35 | Informe spam
This is the code I'm using... but always says I'm not administrator...

function NavigateToVersionsAspx(strHttpRoot, strArgs)
{
url=strHttpRoot + "/_layouts/" + L_Language_Text + "/Versions.aspx?" +
strArgs + "&Source=" + GetSource();
alert(url);
// For WSS use "ModifyPageLink" instead "SettingsOrReturnURL" (Portal
Server)
if (document.getElementById("ModifyPageLink")== null)
alert("Access denied for reader users"); // Insert the code you
want
else
STSNavigate(strHttpRoot + "/_layouts/" + L_Language_Text +
"/Versions.aspx?" + strArgs + "&Source=" + GetSource());

if (document.getElementById("TBBManageContent")== null)
alert("*** Access denied for reader users"); // Insert the code
you want
else
STSNavigate(strHttpRoot + "/_layouts/" + L_Language_Text +
"/Versions.aspx?" + strArgs + "&Source=" + GetSource());
}

"guitar" wrote:

Mostrar la cita
#7 Zucco
21/09/2006 - 19:58 | Informe spam
O comando abaixo traz as permissões do site, tem como alterar para que pegue
as permissões da DocumentLibrary ???

<% spWeb.Permissions.CheckPermissions(SPRights.EditListItems); %>

De:
http://www.gavd.net/servers/sharepo...ru&itm3


"Zucco" wrote:

Mostrar la cita
#8 Zucco
26/09/2006 - 17:32 | Informe spam
I found the command to retrive DocumentLibrary permissions

<% SPList list = spWeb.Lists["ISO"];
list.Permissions.CheckPermissions(SPRights.EditListItems); %>

But I'ld like to use a kind of variable with the Current Document Library
name instead to use the real name.

Someone knows how to get the Current Document Library name ??


"guitar" wrote:

Mostrar la cita
#9 Zucco
28/09/2006 - 22:10 | Informe spam
OK, this is the command (but still missing a little detail)

<% SPView currentView =
spWeb.GetViewFromUrl("http://servername/DocumentLibrary/F...aspx");
SPList currentList = currentView.Views.List; SPList list =
spWeb.Lists[currentList.Title];
list.Permissions.CheckPermissions(SPRights.EditListItems); %>

Now I need to change ("http://servername/DocumentLibrary/F...aspx")
for some command that gets the current URL, someone knows how to do it?

"guitar" wrote:

Mostrar la cita
#10 Zucco
02/10/2006 - 22:06 | Informe spam
Done! This is the line to add on versions.aspx.

<% string url = HttpContext.Current.Request.Url.ToString(); int iPos =
url.IndexOf("&Source="); string url2 = url.Substring(iPos + 8); SPView
currentView = spWeb.GetViewFromUrl(url2); SPList currentList =
currentView.Views.List; SPList list = spWeb.Lists[currentList.Title];
list.Permissions.CheckPermissions(SPRights.EditListItems); %>


"guitar" wrote:

Mostrar la cita
Ads by Google
Search Busqueda sugerida