Getting current user's  member of group

Hi expert(s),
I have developed web application using jsp, now i need to know whether the current user logged in at client PC, is member of certain group available in the database, i can get current user using System.getProperty(), but i have to get the list of groups, he/she belongs to. So that i can check his group to authenticate...
What is the workaround?
Waiting for your kind reply.
Thanks & Regards,
Sri.

Experts, i give you .net code for done my need, i need to convert/use it in java platform, please give me some useful tips.
If G_sSecurityMode = "ADSL" Then
                GUser = System.Environment.UserName
                ReDim sGroup(6)
                'Default NT user groups which will be created at every system during installation
                sGroup(0) = "CPMSDOMAINADMIN"
                sGroup(1) = "CPMSCLIENTADMIN"
                sGroup(2) = "CPMSDATAPREPADMIN"
                sGroup(3) = "CPMSDATAPREPUSER"
                sGroup(4) = "CPMSINVENTORYADMIN"
                sGroup(5) = "CPMSINVENTORYUSER"
                G_sUserGroup = " "  'Global variable defined in GLbdecleration module
                'Loop defined to identify  the group(s) associated with the current NT user
                For i = 0 To 5
                    objGroup = GetObject("WinNT://" & sMachine _
                     & "/" & sGroup(i) & ",group")
                    For Each objUser In objGroup.Members
                        If UCase(GUser) = UCase(objUser.Name) Then
                            G_sUserGroup += "'" + sGroup(i) + "'" + ","
                        End If
                    Next
                Next
                G_sUserGroup = G_sUserGroup.TrimEnd(",") 'To truncate the last "," in a g_susergroup string
                If Len(Trim(G_sUserGroup)) = 0 Then
                    MsgBox("No group(s) defined for the user " + GUser, MsgBoxStyle.Information)
                    Me.Close()
                End If
            Else
                MsgBox("Invalid Security Definition", MsgBoxStyle.Information)
                Me.Close()
            End If

Similar Messages

  • Check current user exist people or group column

    How to check current logged in user name already exist in people or group column of share-point custom list 2013 using c#?
    Note: People or group column contains multiple items.
    Thanks in advance

    You can use javascript to get current user and then perform vlookup on the field
    Current use
    function CallClientOM()
    var context = new SP.ClientContext.get_current();
    this.website = context.get_web();
    this.currentUser = website.get_currentUser();
    context.load(currentUser);
    context.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
    function onQuerySucceeded(sender, args)
    alert(currentUser.get_loginName());
    function onQueryFailed(sender, args)
    alert('request failed ' + args.get_message() + '\n'+ args.get_stackTrace());
    http://spjsblog.com/2010/03/18/vlookup-type-rollup-for-sharepoint/
    If this helped you resolve your issue, please mark it Answered

  • Adding and removing current user from one SharePoint group to another with event receiver

    hi friends
    i need to change current user from one SharePoint group to another with list item adding event receiver.
    please help me

    Hi Malli,
    Greetings. Its nt possible
    http://sharepoint.stackexchange.com/questions/42286/event-receivers-on-add-remove-users
    Please remember to click 'Mark as Answer' on the answer if it helps you

  • How to get Current User Group NAME

    I am using the com.sun.security.auth.module.NTSystem to obtain information on the current user logged into the NT System. This class gives me the user name, all the group SIDs associated with the current user and also the current user's primary group SID.
    But I am not able to retrieve the group Name based on these SIDs.
    Please tell me how to find out the Group Name such as "Workgroup" etc. instead of Group SID.
    This is very urgent. So please help me.
    Thanks in advance!!!

    I'm having the same problem.
    If you found a solution could you post it here.
    Thanks.

  • How to find out by MDX that the current users is member of a role - Default member issue

    Hi,
    just imagine you have a dimension with a few members (A, B, C...). I defined a role which gives some users only rights to "B". On the other hand the default member for the dimension is set to "A". Now users part of the role get an error
    that the member "A" is not found. So while
    https://msdn.microsoft.com/en-us/library/ms175626.aspx says the default member setting in the role "overrides" the overall default member this is not completely true because first the general default member is selected and after that the role
    specific one.
    So the solution might be that I explicitly define the default member in all roles. This might be possible but there is one issue: you can't define a role specific default member for users part of the adminstrator role. So all admins don't have a default
    member which is quite some restriction for some users...
    So the question is how to solve that problem. An idea would be that I use some MDX to determine the default member in the dimension based on the actual user's role membership. But how to do that? Or any better idea?
    Thanks,
    Thomas Pagel

    Hi Thomas,
    According to your description, you want to have a role-specific default member for different roles. Right?
    In Analysis Services, when granting access to dimension, a connection will fail if a role restricts access to a default measure. As you mentioned, the best solution is specify a default member for each role. But for administrator role(full control),
    it can't set the default member. All tabs except General and Membership are disabled. And the system can determines the default member of current user automatically. It's not supported to get the default member in MDX either.
    However, SSAS has additive design for role security. So in this scenario, we just need to create another role for those members of administrator role and specify a default member for this role. SSAS will take that role-specific default member
    for these users. And it will not effect the administration permission for them.
    Reference:
    Default members, MDX Scripts, Security, KPIs and Perspectives
    The Additive Design of SSAS Role Security
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou
    TechNet Community Support

  • Caml query - get current user name

    I have an external list via BDC (so cannot change column type, create calculated column or workflow
    ). There is a text column “Supervisor”. I need to create a view that display all items which the value of “Supervisor” = current login user’s display name or login name (windows user name). 
    I tried set up the field on the UI with [Me] function which does not work because “Supervisor” is not an user/group type column. Now I am working on the code. I found the follow caml query on the web that is close to what I need:
    <Eq>
    <FieldRef Name='Supervisor' LookupId='TRUE'/>
    <Value Type='Integer'><UserID/></Value>
    </Eq>
    I know this only work if the ‘Supervisor’ type is “User”. I just wonder if someone know how to replace the <Value> with a text string
    of the current user’s display name or window name? I really appreciate for any help (I have struggled with this issue for a week).
    Forget to mention that I am working on a web part page in SharePoint designer, not in Visual Studio. So I cannot not using spcontext class.

    Thank you again for your response.  For this method, I need need to find a way to get the current user to a variable, the use the varrible in the query. This works for me:
    <ParameterBinding Name="UserID" Location="CAMLVariable;ServerVariable(LOGON_USER)" DefaultValue="CurrentUserName"/>
    <Eq>
    <FieldRef Name="Supervisor"/>
    <Value Type="Text">{UserID}</Value>
                    </Eq>
                    <Eq>
    <FieldRef Name="AttnMonitor"/>
    <Value Type="Text">{UserID}</Value>
                   </Eq>

  • 713060: Tunnel Rejected: User (user) not member of group (group_name), group-lock check failed.

    Hi,
    I just configure VPN for end users in PIX515e with IOS 8 and get stuck with "Tunnel Rejected: User (msveden) not member of group (VPN-shared), group-lock check failed.". Can someone please help me and tell me how I add user to my VPN group?
    Regards
    Mikael

    May be you are looking for this-
    ASA1(config)# username msveden attributes
    ASA1(config-username)# group-lock value mygroup
    Thanks
    Ajay

  • Get current user in portal service context

    hi guys,
    We want to implement a portal service which will check user's role from LDAP, and we need to get the current user id.
    We know for class IPortalComponentRequest, there is method getUser().getUserId(), is there any similar method for IServiceContext? or any way for us to get user id in portal service?
    regards,
    Guo Feng

    Hi Feng,
    Implement
    public String getParameter(IPortalComponentRequest arg0, String arg1)
    eg in your implementation class and add the following code.
    IUserContext userContext = arg0.getUser();
    String username = userContext.getLogonUid();
    String full_name = userContext.getDisplayName();
    HTH

  • How to get current layer type (text, art, group layer, etc.)r discussion here

    Hi,
    I am traversing over all layers using layerIndex.
    I can get current later name in following way.
    char* layerName = new char[100];
    int32 len = 100;
    PIUGetInfoByIndex(layerIndex,classLayer, keyName, layerName , &len) ;
    I tried  using the keys keyType and keyGroup in the same way but I am not able to directly get type of the layer. Why?
    Also, I found similar discussion, which is check the layer is SectionStart, SectionEnd or SectionContent.
    Get Layer Groups from C++ plugin
    If the layer is a "SectionContent", how to I further check its type (artlayer, textlater, adjustmentlayer, ect) ?

    apologize !
    I post the question in relevant forum. But I would like to ask extra explanation here.
    var ref = new ActionReference();                                                                                                               // create action reference
    ref.putProperty(stringIDToTypeID ("property"), stringIDToTypeID("layerKind"));                                            // add "layerKind" property to the reference
    ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );                   // what putEnumerated actually do ?
    var layerDesc = executeActionGet(ref);                                                                                                      // get the corresponding layer descriptor
    alert (layerDesc.getInteger(stringIDToTypeID("layerKind")));                                                                        / get its layerKind
    1. what putEnumerated actually do ?
    2. I am traversing each layer so that I have the layer object in JavaScript.
        How current layer object is refereed to above code segment ?

  • Not able to get current user in PCD Filter factory implementation method

    hi all,
      In the  PCD Filter factory implementation method . i am using the following code
    public Object getObjectInstance(Object arg0, Name arg1, Context arg2, Hashtable env)
         throws Exception
              if (Constants.ASPECT_NAVIGATION.equals(env.get(Constants.REQUESTED_ASPECT)))
              IUser user = (IUser) env.get(IPcdContext.SECURITY_PRINCIPAL);
              String department="null";
              if (user != null)
                 department=user.getDepartment();
                   if ((department != null) && (!department.equals("")))
              filterExpression = "(" + FilterDepartmentService.Department_ATTRIBUTE_KEY + "=" + department + ")";                             
              return filterExpression;
    but i cannot able to get the current user. how to get the current user in the above method..
    Regards,
    Shanthakumar.

    Hi,
      First print the output for env.get(IPcdContext.SECURITY_PRINCIPAL);
    If it returns null, set it from the request object first (from the method where Hashtable is declared and request obj is available) and then use it in this getObjectInstance method.
    env.put(IPcdContext.SECURITY_PRINCIPAL, request.getUser());
    Regards,
    Harini S

  • Urgent : How to get current user id

    Hello,
    fnd_global.user_id returns -1
    fnd_profile.get('user_id',x_user_id) return null
    can anyone help how to get current logged in user to apps.
    Regards,
    Dinesh.

    Hi Dinesh,
    You must also make sure you have initialised the app.
    If you run this from sqlplus then it will return -1.
    If however you run this from within a concurrent program then the user id will be returned.
    Try using this from sqlplus fnd_global.apps_initialize
    Eg.
    begin
    dbms_output.put_line(fnd_global.user_id);
    fnd_global.apps_initialize(user_id => 3551,
    resp_id => 1,
    resp_appl_id => 1);
    dbms_output.put_line(fnd_global.user_id);
    end;
    /

  • How to get current user in Exchange 2007 OWA customization page?

    Hi,all
    I customize an ASPX page(smsconfig.aspx) in Exchange 2007 OWA( this file in ..\Exchange\ClientAccess\OWA\smsconfig.aspx, I don't modify registry.xml & web.config).
    My Exchange 2007 OWA has been configurated with Forms-Based Auth.
    https://mail.myexchange.com/owa/smsconfig.aspx The page works fine, but it cannot get current logon user with HttpContext.Current.User.Identity or
    UserContext.MailboxIdentity or UserContext.LogonIdentity
    <%@ Page language="c#" AutoEventWireup="false" Inherits="Microsoft.Exchange.Clients.Owa.Core.OwaPage" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <%@ Import namespace="Microsoft.Exchange.Clients"%>
    <%@ Import namespace="Microsoft.Exchange.Clients.Owa.Core"%>
    <%@ Import namespace="Microsoft.Exchange.Clients.Owa.Premium"%>
    <%@ Import Namespace="System" %>
    <%@ Import Namespace="System.Data" %>
    <%@ Import Namespace="System.Data.SqlClient" %>
    <%@ Import Namespace="System.Xml" %>
    <%@ Import Namespace="System.Collections.Generic" %>
    <%@ Import Namespace="System.Text" %>
    <script runat="server">
    。。。(my codes in here)
    </script>
    thanks for your help.
    Your Passion.My Potential.

    Microsoft.Exchange.Clients.Owa.Core.OwaContext.Current.UserContext.LogonIdentity.PrimarySmtpAddress
    Высказанное мною здесь - мои личные взгляды, а не позиции корпорации Microsoft. Вся информация предоставляется "как есть" без каких-либо гарантий.

  • To get current user through trigger

    Hi,
    I want audit trail through database trigger. But I noticed in trigger 'portal30.wwctx_api.get_user' is failed to parse. Is there any way to get the current user in trigger?
    Thanks,
    Sumita

    Prior to calling the get_user function you'd need to set the context first by invoking the wwctx_api.set_context method.
    Peter

  • Getting current user

    How do i get the current user name/details on weblogic 8.1 server.
    I used to use 'weblogic.security.acl.Security.getCurrentUser()' in weblogic 6.1
    but i'm investigating moving to weblogic 8.1 and this no longer works. I assume
    i should be using MBeans but not really sure exactly which one.
    Any pointers would be very helpful.
    Thanks in advance
    Alan

    Thanks - I was looking to deeply into the problem.
    "Anders Mathisen" <[email protected]> wrote:
    in which context is this, servlet/jsp or ejb?
    in a jsp try the request.getRemoteUser(), or in an EJB use the EJBContext
    and retreive the principal.
    - Anders Mathisen
    "Alan" <[email protected]> wrote in message
    news:3fdf3e12$[email protected]..
    How do i get the current user name/details on weblogic 8.1 server.
    I used to use 'weblogic.security.acl.Security.getCurrentUser()' inweblogic 6.1
    but i'm investigating moving to weblogic 8.1 and this no longer works.I
    assume
    i should be using MBeans but not really sure exactly which one.
    Any pointers would be very helpful.
    Thanks in advance
    Alan

  • Query to get which user assign to what group in OID

    Hi All,
    Can you please help me out to get the details of users assigned to which groups in OID.
    I required sql query for the same.
    Please suggest for such query.
    Thanks-
    P

    You will use LDAP queries, not SQL.  You can query the objectclass of the group and the attribute with the multi value entry for the user.  Example:
    (&(objectclass=groupofuniquenames)(memberof=*)) ->  This will show you all groups that have members.
    (&(objectclass=groupofuniquenames)(memberof=cn=Joe Schmoe,cn=Users,dc=location,dc=com))  ->  Will show you all the memberships a specific user has.
    -Kevin

Maybe you are looking for

  • Submit a Report from another report

    I have 2 reports a and b. Both have similar selection screen. The only difference is that the mandatory fields of the 2 reports are different from each other. My requirement is that, when the user selects a radio button 'Summary' in report 'a' , it s

  • File paths to ID3Tags

    I'm new to iTunes. I've brought 5000 plus mp3's into iTunes that I originally imported using Roxio's software over the years. Some of the mp3's have tags, most don't. My library is organized in folders by artists then album name and the mp3's are nam

  • EData - Import Excel

    I am trying to run an import from an Excel sheet and am getting the following error messages: [Selection] XLFILE=\HO\FINANCE\DataManager\DataFiles SAPSAMPLE.xls SHEET=SAPSAMPLE COLUMNS=Account,CostCentre,Time,Product,Project,LoB,Version,Chanel,Entity

  • How To Find Last Row With Data +2, Then Format?

    I need to find the last row +2, select the range A:L, then format. Could someone please supply the code?  I can handle the format part. Thanks! A. Wolf

  • My ipad display has turned x-ray.  Is it broken or has settings been changed.

    My ipad display has turned x-ray.  Is it broken or has the settings been changed?