user-roles

how to customize publish action - sitecore

北城余情 提交于 2019-12-25 16:02:42
问题 I created a user in sitecore with 2 roles assigned to him i.e author and publisher When this user who is both author and publisher creates any content he shouldn't be able to publish it. Can i overwrite the publish action? check on the user who submitted the content and the roles he is assigned to and restrict him with a popup message or something like that? Any help is appreciated. Thanks. 回答1: Follow the below steps to write custom publish actions For customizing the publish action, Write a

Wordpress custom plugin not shown in roles except admin

柔情痞子 提交于 2019-12-25 08:15:57
问题 I wrote a custom wordpress plugin that is shown in the left menu bar in the backend of WP. My problem is, that it is just shown if I log in as an administrator. If the editor logs in he can't see it. Is there any way that I can enable it so that every role can see it? I tried to google the problem but didn't get any satisfying results, that's why I am asking it here. Thanks for your answer! 回答1: You need to set the proper capability, third parameter in the add_option_page() function which you

Rails, Devise, Role Model and CanCanCan - defining abilities

我们两清 提交于 2019-12-25 06:36:31
问题 I am using Rails 4 to make a web app. I am trying to use CanCanCan to define abilities for the various roles. I have a User model and a Profile model. Each user can have many profiles. Each profile can have a different role. In my Profile.rb, I have defined my roles (using Role Model gem) as: include RoleModel roles :admin, :manager, # coalfacer :student, :educator, :researcher, :ktp, :faculty_manager, :ip_asset_manager, # for universities :sponsor, # for industry :project_manager,

Change product status if prices are updated in Woocommerce 3

空扰寡人 提交于 2019-12-24 10:17:46
问题 I need to change product post_status in a hook. I trying to make product get back to "pending" status everytime vendor change the price. add_action( 'updated_post_meta', 'mp_sync_on_product_save', 10, 4 ); function mp_sync_on_product_save( $meta_id, $post_id, $meta_key, $meta_value ) { if ( $meta_key == '_price' ) { // edited price if ( get_post_type( $post_id ) == 'product' ) { $product = wc_get_product( $post_id ); $product['post_status'] = 'pending'; //how to update this? // var_dump(

Cannot get the UserManager class

末鹿安然 提交于 2019-12-23 19:21:17
问题 What I'm trying to do is to add a new admin user and assign it with the admin role. So.. I went to the Startup.cs class in Configure method and wrote the following code: var context = app.ApplicationServices.GetService<ApplicationDbContext>(); // Getting required parameters in order to get the user manager var userStore = new UserStore<ApplicationUser>(context); // Finally! get the user manager! var userManager = new UserManager<ApplicationUser>(userStore); However, I get the following error

How to implement role-based access control Java/MySql?

Deadly 提交于 2019-12-23 10:40:16
问题 I am planing to start a web-based project that involves user registrations just like forums/CMS, but my barrier is that I have not idea how to implement the so-called role-based access control. I googled for "role-based access control" and I found in the results books about: Design Patters. Is this related to what I need? Is there a tutorial about implementing this idea? Is the implementation on database-side or language programming-side? Any reference? Any title? 回答1: Design your tables such

How to restrict web service data contract properties based on user role

家住魔仙堡 提交于 2019-12-23 04:13:10
问题 I have the following web service: [DataContract] public class Project { public long Id { get; set; } public string Name { get; set; } } [OperationContract] public Project GetProject(long Id); Now I want to add a SecretData property that should only be exposed to certain users. I've come up with several ideas, but none of them sit quite well with me: Add a nullable SecretData property to Project . If the user doesn't have permission to view it, set it to null . This seems like the simplest

Parse.com, Adding users to created roles

╄→尐↘猪︶ㄣ 提交于 2019-12-22 18:03:21
问题 I have a cloud code which creates two account roles when a user signs up. Below is the method Parse.Cloud.afterSave("account", function(request) { var accountName = request.object.get("name"); //create admin role var adminRoleACL = new Parse.ACL(); adminRoleACL.setPublicWriteAccess(true); var adminRole = new Parse.Role(accountName + "_Administrator", adminRoleACL); adminRole.save() ; //create user role var userRoleACL = new Parse.ACL(); userRoleACL.setPublicWriteAccess(true); var userRole =

ColdFusion: Application Options Based on Role?

青春壹個敷衍的年華 提交于 2019-12-22 00:13:09
问题 I understand how to restrict entire pages, or even components by implementing <cflogin> and roles. For example: <cfif IsUserInRole("Admin") OR IsUserInRole("Accounting")> ...You can view this page... <cfelse> ...You can not view this page... </cfif> But how is it recommended to restrict certain facets of a page? Say for example an "Admin" is allowed to send Global Messages to all users, but that option is not available for a regular "User" I suppose I could use the Session to manipulate my

Customizing footer text email notiications based on user role in Woocommerce

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-21 22:43:55
问题 I'm trying to edit the Woocommerce customer emails based on whether the user who ordered was a 'wholesale_customer'. If they are i want to edit the footer text to display a different name and maybe change the logo but at this time the name is more important. I'm using the woocommerce_footer_text function to try and edit but when I test it, the footer text isn't displaying. Can anyone help please? add_filter( 'woocommerce_email_footer_text', 'woocommerce_footer_text', 10, 2 ); function