I have a membership ID I just want to pull the membership details from woo-commerce. I was doing this with the active membership function(wc_memberships_get_user_active_memberships) which gives me the currently active membership for the user also I use the wc_memberships_get_user_memberships which is giving me all the memberships for a user, but I want a particular membership whose ID I have.
Edit:
Got the function in woocommerece documentation $user_membership = wc_memberships_get_user_membership($user_membership_id);
Related
I have membership setup which is linked to a subscription when a product is purchased. I want to add another membership for elite members but I want to tie it to the first membership. So if membership A which is linked to a subscription expires then membership B must also expire.
So membership B must be linked to Membership A as it's a requirement to have a active membership A in order to have membership b.
How can I do this?
Have not managed to find a solution
I'm integrating buddyboss with buddycommerce, so we can see the type of membership.
but we can only see our membership (current user), how do we get other users to see our membership type, or we can see another user membership displayed on buddyboss profile page..
Buddycommerce membership display as public
We have four claims:
CanViewPosts, CanEditPosts, CanAddPosts, CanDeletePosts
Now, I want to create a role Moderator and assign two claims CanViewPosts, CanEditPosts to this role.
Then, I create a user with mail moderator#example.com and assign the Moderator role to this user.
I can assign roles to a user, but I want to dynamically assign claims to a role. Because, I will give multiple users, a same role.
How can I implement this in .NET Core 5 ?
yes you can assign claims and roles in identity server, if you are using identity server use claim type of role and claim value is CanViewPosts, CanEditPosts
I have an application that uses a client table, a company user table and an admin user table to manage companies. Companies have an admin area where they manage their users with roles of what their users can do, and a level above that the admin manages users that have their roles for managing all companies.
The question is: I want to use asp.net identity with authorize and roles in the appropriate controllers. Is there a way to integrate the existing user tables and roles for all three levels of users?
you can create a referrence table with many to many relationship to the asp.net users table like the below:
1- ASP.NET Users (The one Identity provider will give you)
2- Custom Table called (CompanyUsers) that takes the company ID and User ID
3- all tables linked to the above custom table
I'm trying to implement some role-based functionality in my web application (.NET 4.0.3) so that I can control what menu items users can see based on their roles, either Administrator or User.
I'm simply using existing AD groups to administer the roles. Let's say there is a team in my organisation that is represented by an AD group called IT-Managers, and there is another team with AD group IT-Support. I simply want to map IT-Managers as Administrator and IT-Support as User.
I can easily use WindowsPrincipal.IsInRole() to check whether the currently logged-in user belongs to either group, but how do I tell the application that the logged-in user holds the Administrator role or the User role, therefore sitemap security trimming can pick this up?
By implementing your custom Role Provider. Once implemented you can easily use the ASP.NET role provider framework....
Roles.IsUserInRole("Admin");
Roles.GetUsersInRole("Users");
etc.
You can implement a Role Provider by implementing the RoleProvider abstract class or by extending an existing one such as SqlRoleProvider. There's a lot of extensive documentation out there. I'll paste a couple of links
http://msdn.microsoft.com/en-us/library/aa478950.aspx
http://www.codeproject.com/Articles/28546/Active-Directory-Roles-Provider